Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int size = 700, dimenzije_jedinke = 40;;
- float x = 0, y = 550, brzina = 1;
- color izdrzljivost = color(50), nebo = color(135, 206, 250), tlo = color(34, 104, 34);
- void setup() {
- size(700, 700);
- }
- void draw() {
- background(nebo);
- fill(tlo);
- rect(0, y + dimenzije_jedinke, size, y - dimenzije_jedinke);
- move();
- display();
- }
- void move() {
- x = x + brzina;
- if (x > size) {
- x = 0;
- }
- }
- void display() {
- fill(izdrzljivost);
- rect(x, y, dimenzije_jedinke, dimenzije_jedinke);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement