Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local carre = Image.createEmpty(2,2)
- carre:clear(Color.new(255,0,0))
- local x = 5
- local y = 100
- while true do
- screen:clear()
- pad = Controls.read()
- if pad:left() then x = x - (x > 0 and 3 or 0) end
- if pad:right() then x = x + (x < 480 and 3 or 0) end
- if pad:up() then y = y - (y > 0 and 3 or 0) end
- if pad:down() then y = y + (y < 272 and 3 or 0) end
- screen:blit(x,y,carre)
- screen:drawLine(470,0,470,272,Color.new(255,255,255))
- screen:print(5, 5, x >= 472 and "Tu Gagne!" or "Tu Perds !", x >= 472 and Color.new(0,255,0) or Color.new(255, 0, 0))
- screen.flip()
- screen.waitVblankStart()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement