:Ì À À ÀÀ À Ì >Jðÿÿÿÿÿðÿÿððÿÿðÿðÿÿÿðÿÿðÿÿÿðÿðÿÿÿÿðÿÿðÿðÿðÿÿÿÿÿððÿðÿÿÿðÿððÿðÿðððððÿððÿðÿÿÿÿÿÿððÿÿðÿÿðððÿðÿððððÿððððÿÿðÿðÿÿðÿÿÿÿÿÿðððÿÿÿÿðÿðÿÿÿÿ™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™--- title: tuto_jeux_variable -- author: OdiStudio Games, email, etc. -- desc: faire exploser la balle au contact du joeur -- site: website link -- license: MIT License (change this to your license of choice) -- version: 0.1 -- script: lua -- variable du player player={ x=10; y=60; sp=1; } -- variable de la balle balle={ x=240; y=63; r=4; c=12; vx=1; p=240 } -- variable du score score={ sc=0; hisc=10; } -- affichage de la scene du jeux function drawGame() -- les fonction de calcule Balle() controller() -- affichage du joueur spr(1,player.x,player.y,0) -- affichage de la balle circ(balle.x,balle.y,balle.r,balle.c) circb(balle.x,balle.y,balle.r,balle.c+1) end -- controlle player function controller() --if btn(4) then print(4) end if btnp(4) and balle.x>=12 and balle.x<=25 then balle.x=balle.p score.sc=score.sc+1 balle.vx=balle.vx+0.2 end end -- comportement de la balle function Balle() balle.x=balle.x-balle.vx if balle.x<=-20 then balle.x=balle.p balle.vx=1 score.sc=0 zero=GameOver end end -- gestion du score function Score() print("Score : "..score.sc,0,0) print("High Score : "..score.hisc,160,0) if score.sc>score.hisc then score.hisc=score.sc end end -- menu scene c=1 t=0 function menu() print("Tuto_Game",60,40,c,1,2) c=c+0.2 t=t+1 if t<=20 then elseif t>=20 and t<40 then print("press (x) to play",130,120,12) elseif t>=40 then t=0 end if btnp(5) then zero=drawGame end end -- Game Over scene function GameOver() print("GAME OVER",60,40,c,1,2) c=c+0.2 t=t+1 if t<=20 then elseif t>=20 and t<40 then print("press (x) to back menu",120,120,12) elseif t>=40 then t=0 end if btnp(5) then zero=menu end end -- gestion des scene du jeux function zero() zero=menu end function TIC() cls(0) zero() Score() end