Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int
- // ball
- x, y,
- speed,
- // gates
- w, // half width
- h, // half height
- angle,
- weight;
- int points;
- void setup () {
- size (1280, 740);
- rectMode (CENTER);
- // ball
- x = width / 2;
- y = height;
- speed = -(height / 50);
- // gates
- w = width / 6; // half width
- h = width / 10; // half height
- weight = width / 60;
- angle = w / 4;
- }
- void ball () {
- y += speed;
- if (y < 0) {
- y = height;
- x = int (random (0, width));
- }
- noStroke ();
- fill (255);
- circle (x, y, height / 10); // kamuolys
- }
- void draw () {
- background (125, 255, 125);
- ball ();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement