Attempt to add sprites
This commit is contained in:
40
pyras.p8
40
pyras.p8
@ -43,7 +43,8 @@ end
|
||||
|
||||
function drawguy()
|
||||
local spd=guy.speed
|
||||
drawpixel(guy.x,guy.y,11)
|
||||
local size=game.pixelsize
|
||||
spr(size-1,guy.x*size,guy.y*size)
|
||||
guides={
|
||||
{guy.x-spd,guy.y-spd},
|
||||
{guy.x ,guy.y-spd},
|
||||
@ -55,7 +56,7 @@ function drawguy()
|
||||
{guy.x+spd,guy.y+spd}
|
||||
}
|
||||
for g in all(guides) do
|
||||
drawpixel(g[1],g[2],6)
|
||||
spr(15+size,g[1]*size,g[2]*size)
|
||||
end
|
||||
end
|
||||
-->8
|
||||
@ -87,12 +88,14 @@ function movepyras()
|
||||
end
|
||||
|
||||
function drawandeatpyras()
|
||||
local size=game.pixelsize
|
||||
for index,pyra in ipairs(pyras) do
|
||||
if getpixel(pyra.x,pyra.y)==8 then
|
||||
local pxlclr=getpixel(pyra.x,pyra.y)
|
||||
if pxlclr==8 or pxlclr==10 then
|
||||
sfx(0)
|
||||
deli(pyras,index)
|
||||
else
|
||||
drawpixel(pyra.x,pyra.y,8)
|
||||
spr(31+size,pyra.x*size,pyra.y*size)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -118,7 +121,7 @@ function drawbg()
|
||||
local offset=1
|
||||
if(#pyras>9)offset+=1
|
||||
if(#pyras>99)offset+=1
|
||||
rectfill(0,0,127,127,1)
|
||||
rectfill(0,0,127,127,5)
|
||||
print(#pyras,128-4*offset,1,7)
|
||||
print("l:"..game.level,1,1,7)
|
||||
end
|
||||
@ -168,7 +171,7 @@ end
|
||||
function drawgame()
|
||||
cls()
|
||||
drawbg()
|
||||
if(game.state==1)drawguy()
|
||||
if(game.state>=1)drawguy()
|
||||
drawandeatpyras()
|
||||
if game.state==0 then
|
||||
rect(46,46,80,80,7)
|
||||
@ -215,12 +218,26 @@ function getpixel(x,y)
|
||||
)
|
||||
end
|
||||
__gfx__
|
||||
e00000001e0000004440000044440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000e10000001e1000001ee10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000e7e00000e77e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000ee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
60000000660000006060000060060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000660000000f0000000ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000606000000ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000060060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
a0000000a80000008880000088880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
000000008a000000a8a00000a88a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000008f8000008ff80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000088880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
__label__
|
||||
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111181111
|
||||
17181111177711111111111111111111111118111111111111111111111111111111111111111111111111111111111111111111111111111111777177717771
|
||||
@ -351,6 +368,9 @@ __label__
|
||||
11111111111111111111111111111111111111111111118111111111111111111111111111111111111111111811111111111111111111111111111111111111
|
||||
11118111111111111111111111111111118111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
|
||||
|
||||
__gff__
|
||||
0000000000000000000000000000000000000000000000000000000000000000010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
__sfx__
|
||||
000100002e05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
9d0800000215000000000001910018100021500000000000021500000002150000000000014100131000515000000121000415000000041500000011100021500000002150000000010001150000000215000100
|
||||
|
Reference in New Issue
Block a user