Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
billythemusical committed May 27, 2021
1 parent 58cf678 commit 9a37f47
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions p5-ableton/sketch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
This sketch will move a ball on our p5 canvas and
send an OSC message each time the ball hits a wall.
- Billy Bennett, ITP NYU, May 2021
*/


// we need a handle to the socket to send our osc values
var socket;
var isConnected;
Expand Down Expand Up @@ -29,12 +36,12 @@ function draw() {

// check if the ball hits a wall and send a message if so
if (x > width || x < 0) {

// reverse the direction
xSpeed *= -1
sendOsc('message', 1);

} else if (y > height || y < 0) {

// reverse the direction
ySpeed *= -1
sendOsc('message', 1);

Expand Down

0 comments on commit 9a37f47

Please sign in to comment.