# How do I make it work? logic question

**URL:** <https://discourse.processing.org/t/how-do-i-make-it-work-logic-question/3938>\
**Category:** Libraries\
**Created:** [September 28, 2018, 4:45pm UTC](https://discourse.processing.org/t/how-do-i-make-it-work-logic-question/3938 "2018-09-28T16:45:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leereset](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@leereset](https://discourse.processing.org/u/leereset)\
**Post date:** [September 28, 2018, 4:45pm UTC](https://discourse.processing.org/t/how-do-i-make-it-work-logic-question/3938/1 "2018-09-28T16:45:20Z")

</div>

Hi I’m making project that where footprint created when person pass by.

check my progress.  
you can check here:

> **[jeongcatfish/mars](https://github.com/jeongcatfish/mars)**
>
> Contribute to jeongcatfish/mars development by creating an account on GitHub.

  
Use your mouse pointer to create footprint.

Issue:  
As you see my project, if I step forward any direction previous footprint disappear right away.  
but I hope the previous footprints don’t go away right away. I hope it slowly removed by alpha values.

should I change whole code?

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [September 28, 2018, 5:12pm UTC](https://discourse.processing.org/t/how-do-i-make-it-work-logic-question/3938/2 "2018-09-28T17:12:51Z")

</div>

Hi leereset,

To do what you want to achieve, you can simply store your footprint in an `arrayList`.

Every time your create a footprint, you add that footprint to the list and you do that up to 10 footprints for example (but it can be any number that you want). This number will represent the number of footprints visible at the same time. When you add a footprint and you got more than 10 footprint you simply need to remove the last item from the list.

Next you would have an array of opacity (or even color) the same size as your footprints arrayList. Each slot will represent the opacity of the corresponding footprint in the arrayList. So then in `draw()` you can erase everything at every frame and loop through your arrayList to draw the footprints one by one, using the value of the array as opacity.

---

<div class="post-metadata">

**Author:** ![leereset](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@leereset](https://discourse.processing.org/u/leereset)\
**Post date:** [September 29, 2018, 1:41am UTC](https://discourse.processing.org/t/how-do-i-make-it-work-logic-question/3938/3 "2018-09-29T01:41:03Z")

</div>

Thank you  
I actually new to processing so I have to learn about what arraryList is.

I’ll try. !

---

<div class="post-metadata">

**Author:** ![leereset](https://avatars.discourse-cdn.com/v4/letter/l/ee59a6/32.png) [@leereset](https://discourse.processing.org/u/leereset)\
**Post date:** [September 29, 2018, 6:46am UTC](https://discourse.processing.org/t/how-do-i-make-it-work-logic-question/3938/4 "2018-09-29T06:46:45Z")

</div>

thank you. It works good with arrayList. 🙂
