Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=200
- y=130
- rojo=color.new(255,0,0)
- --Creamos las variables e iniciamos el Bucle
- while true do
- --Lectura de controles
- controls.read()
- --Lectura de botones
- if controls.press("up") then y=y-1 elseif controls.press("down") then y=y+1 end
- if controls.press("left") then x=x-1 elseif controls.press("right") then x=x+1 end
- --Dibujamos un rectangulo en las variables
- draw.fillrect(x,y,20,20,rojo)
- --Actualizamos
- screen.flip()
- --Si pulsas START provocarás un error (Para no tener que salir del Homebrew =)
- if controls.start() then broke() end
- end
Add Comment
Please, Sign In to add comment