Dot Grid

For my final project I decided to attempt to recreate a GIF I had seen. I used processing and initially had trouble remembering some things like setting up an array for example. I used two arrays of dots that were set up in a grid. They would have moved in a sort of triangle formation around each other but I was never able to get that to work. My biggest issue was repeatedly creating a pause in the movement. I tried two different ways of doing this. One way was to store the number of milliseconds since the program started by using the millis() command into a variable. I then tried to check the time since I had stored it by subtracting the variable from the milliseconds since the program started. I was never able to make this work and it actually crashed a couple of times when I tried to use a while loop.  Here is an example of some of that code:

int wait = 1000;
int time;
time = millis();
if (millis() – time <= wait)
x = x + xvel;
y = y + yvel;

My other method of trying to implement the timing and movement was to count the number of frames since the program started. This essentially did the same thing as the milliseconds but it performed slightly better and I still have an idea of how I might be able to make it work.

I have not been able to make this work yet so I improvised by using the frame count and some randomization to create what I have now. You can view it here:

I still intend to continue working on this and hopefully find a way to make it work.



Leave a Reply

Your email address will not be published. Required fields are marked *