Advertisement
Kirabo

(Vanja) Teren mk1

Nov 23rd, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. int size = 700, dimenzije_jedinke = 40;;
  2. float x = 0, y = 550, brzina = 1;
  3. color izdrzljivost = color(50), nebo = color(135, 206, 250), tlo = color(34, 104, 34);
  4.  
  5. void setup() {
  6. size(700, 700);
  7. }
  8.  
  9. void draw() {
  10. background(nebo);
  11. fill(tlo);
  12. rect(0, y + dimenzije_jedinke, size, y - dimenzije_jedinke);
  13. move();
  14. display();
  15. }
  16.  
  17. void move() {
  18. x = x + brzina;
  19. if (x > size) {
  20. x = 0;
  21. }
  22. }
  23.  
  24. void display() {
  25. fill(izdrzljivost);
  26. rect(x, y, dimenzije_jedinke, dimenzije_jedinke);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement