Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
p5js-animation [2025/04/02 23:29] – renick | p5js-animation [2025/04/02 23:41] (current) – renick | ||
---|---|---|---|
Line 117: | Line 117: | ||
Math.sin(0) | Math.sin(0) | ||
| | ||
- | Unlike Math.random, | + | Unlike Math.random, |
let x, y; | let x, y; | ||
Line 160: | Line 160: | ||
x = Math.abs(Math.sin(frameCount/ | x = Math.abs(Math.sin(frameCount/ | ||
- | Here's a full example with a few other things adjusted to make it easier to see. | + | Here's a full example with a few other things adjusted to make it easier to see. Have a look at it in the p5js editor here: https:// |
let x, y; | let x, y; | ||
Line 227: | Line 227: | ||
===== a complete example ===== | ===== a complete example ===== | ||
- | You might just want to see the ball float from left to right without going up and down. Here's the complete code for that, along with some animated text to help you understand what is going on. | + | You might just want to see the ball float from left to right without going up and down. Here's the complete code for that, along with some animated text to help you understand what is going on. See it in action on the p5js editor: https:// |
let x, y; | let x, y; |