How do I make it work? logic question

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

check my progress.
you can check here:


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?

1 Like

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.

2 Likes

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

I’ll try. !

thank you. It works good with arrayList. :slight_smile:

1 Like