Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) add an ellipse to your program
- 2) make the ellipse move with your mouse using mouseX , mouseY
- 3) using "if" try to limit the mouse movement e.g
- if(mouseX > 200)
- {
- }
- 4) expirement with color using fill(255,0,0); (change color values)
- 4) advanced - write a program that tries to imitate a "collision" between two objects. using a state machine.
- the objects can be two
- ellipse(100,100,100,100);
- remember this is a an empty program
- void setup()
- {
- }
- void draw()
- {
- }
- remember we learnt how to move an ellipse on screen with a variable
- void setup()
- {
- }
- int xpos = 0;
- void draw()
- {
- xpos = xpos + 1;
- ellipse(xpos , 100 , 100,100);
- }
- and here is an example of an empty state machine
- int state = 0;
- void setup()
- {
- }
- int xpos = 0;
- void draw()
- {
- if(state ==0)
- {
- }
- xpos = xpos + 1;
- ellipse(xpos , 100 , 100,100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement