Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int
- // ball
- x, y,
- speed,
- size,
- // 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);
- size = height / 20;
- // 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));
- }
- //y = height / 2;
- noStroke ();
- fill (255);
- //circle (x, y, height / 10); // kamuolys
- // dėžutė
- noStroke ();
- fill (255, 0, 0); // raudona
- square (x, y, size * 2);
- // juosta
- stroke (255, 215, 0); // geltona
- strokeWeight (weight / 2);
- line (x - size, y, x + size, y);
- //line (x - height / 20, y, x + height / 20, y);
- // size = height / 20;
- line (x, y - size, x, y + size);
- // kaspinas
- noFill ();
- circle (x - size / 3, y - size * 1.25, size / 2);
- circle (x + size / 3, y - size * 1.25, size / 2);
- }
- void draw () {
- background (125, 255, 125);
- ball ();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement