Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (cursor.pos.x > 100 || cursor.pos.x < 0) {
- cursor.vel.x = -cursor.vel.x;
- }
- if (cursor.pos.y > 100 || cursor.pos.y < 0) {
- cursor.vel.y = -cursor.vel.y;
- }
- cursor.pos.x += cursor.vel.x;
- cursor.pos.y += cursor.vel.y;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement