il y a une solution pour augmenter cela ou j'arrète de suite ?
- Code: Select all
vie=3
score=0
raqpos=100
raqlon=30
raqtype=1
level=2
palet={raqpos,202}
niv={{1,1,1,1,2,3,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,4,5,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1
},
{0,1,1,1,2,3,1,1,1,1,1,
0,1,1,1,1,1,1,1,1,1,1,
1,0,1,1,1,1,1,1,1,1,1,
1,0,1,1,4,5,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,4,4,4,4,4,4,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1
}}
function on.paint(gc)
interface()
raquette(raqpos,raqtype)
curseur()
for b = 1, 14 do
for a = 1, 11 do
if niv[level][a+11*(b-1)]~=0 then
brique(a,b,niv[level][a+11*(b-1)])
end
end
end
end
function brique(x,y,type)
if type==1 then
platform.gc():setColorRGB(40,40,40)
elseif type==2 then
platform.gc():setColorRGB(80,80,80)
elseif type==3 then
platform.gc():setColorRGB(120,120,120)
elseif type==4 then
platform.gc():setColorRGB(255,0,0)
elseif type==5 then
platform.gc():setColorRGB(0,255,0)
end
platform.gc():fillRect(x*22-16,y*9-3,20,7)
end
function raquette(x,type)
if type == 1 then
platform.gc():fillRect(x,204,raqlon,3)
elseif type == 2 then
platform.gc():fillRect(x,204,raqlon,3)
elseif type == 3 then
platform.gc():fillRect(x,204,raqlon,3)
end
end
function curseur()
platform.gc():fillRect(palet[1]+raqlon/2,palet[2],3,3)
end
function interface()
platform.gc():setColorRGB(0,0,0)
platform.gc():drawRect(4,4,244,204)
platform.gc():drawString("SCORE",260,30)
platform.gc():drawString(score,280,45)
platform.gc():drawString("LIFE",270,70)
platform.gc():drawString(vie,280,85)
end
function refresh()
platform.window:invalidate()
end
function on.arrowKey(key)
if (key == "left") then
raqpos = raqpos-5
elseif (key == "right") then
raqpos = raqpos+5
end
refresh()
end