Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class carro{
  2.  
  3. float x, y, z, largo, ancho;
  4. float velocidad;
  5.  
  6. carro(float _x, float _y, float _largo, float _ancho){
  7. x = _x;
  8. y = _y;
  9. largo = _largo;
  10. ancho = _ancho;
  11. velocidad = random(30);
  12. }
  13.  
  14. void mover(){
  15. x+=velocidad;
  16. if(x>width) x=0;
  17. }
  18.  
  19. void mostrar(){
  20. fill(17,29,216);
  21. rectMode(CORNER);
  22. rect(x, y, largo, ancho);
  23. ellipseMode(CENTER);
  24. fill(0);
  25. ellipse(x+30, y+30, largo/7, ancho/2);
  26. ellipse(x+70, y+30, largo/7, ancho/2);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement