Guest User

Untitled

a guest
Oct 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. float vit=1;
  2. int taille =50;
  3. PVector[] squares;
  4.  
  5. void setup() {
  6. size(600, 600);
  7.  
  8. squares = new PVector[] {
  9. new PVector(0,0),
  10. new PVector(taille,taille),
  11. new PVector(width,0),
  12. new PVector(width+taille, taille)
  13. };
  14. }
  15.  
  16. void draw() {
  17. background(0);
  18. for (PVector s : squares) {
  19. rect(s.x - width, s.y, taille, taille);
  20. s.x = (s.x + vit) % (width*2);
  21. }
  22. }
Add Comment
Please, Sign In to add comment