Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rectangle starts at location x
- float x = 0;
- void setup() {
- size(200, 200);
- }
- void draw() {
- background(255);
- // Display object
- fill(0);
- rect(x, 100, 20, 20);
- // Increment x
- if (x<100) {
- x = x + 1;
- } else {
- x = 100;
- }
- println(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement