Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class carro{
- float x, y, z, largo, ancho;
- float velocidad;
- carro(float _x, float _y, float _largo, float _ancho){
- x = _x;
- y = _y;
- largo = _largo;
- ancho = _ancho;
- velocidad = random(30);
- }
- void mover(){
- x+=velocidad;
- if(x>width) x=0;
- }
- void mostrar(){
- fill(17,29,216);
- rectMode(CORNER);
- rect(x, y, largo, ancho);
- ellipseMode(CENTER);
- fill(0);
- ellipse(x+30, y+30, largo/7, ancho/2);
- ellipse(x+70, y+30, largo/7, ancho/2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement