Changement waveball pour un mouvement vertical

This commit is contained in:
Bertrand Benjamin 2018-05-02 08:42:10 +03:00
parent 1af2291059
commit 57c54f92c2
1 changed files with 2 additions and 2 deletions

View File

@ -114,7 +114,7 @@ var myp5 = new p5(circleBall, 'c4');
var myp5 = new p5(circleBall, 'c4bis');
var waveBall = function (p) {
var x = 25;
var x = 50;
var y = 25;
var ballRadius = 20;
var t = 0;
@ -127,7 +127,7 @@ var waveBall = function (p) {
p.background(white);
p.fill(black);
t += speed;
x = p.cos(t) * pathRadius + 50;
y = p.cos(t) * pathRadius + 50;
p.ellipse(x, y, ballRadius, ballRadius);
}
};