daneden / daneden/processing-flow-field

ArrayOutOfBounds solution

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Processing
Stars
13
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Great code!
I actually did the exact same thing, also after watching Shiffman's tutorial on youtube.
I encountered the exact same problem as you with the "ArrayOutOfBounds"- yaddi yadda.
Funny thing is I actually came up with the same solution as you but later came up with an alternative one;
in the "edges()" function in the Particle class, you make sure that the particles never reach the edges of the screen. like this:
instead of:
if (x > width) { x = 0; }
you write this:
if (x > width - 1 ) { x = 1; }

Although Im still curious as to why Shiffman didn't expericen the same problem as we did. Have you found out anything about it? I figure it has something to do with some difference between Processing and p5js, but I have no clue...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.