-- title: game title
-- author: game developer, email, etc.
-- desc: short description
-- site: website link
-- license: MIT License (change this to your license of choice)
-- version: 0.1
-- script: lua
t=0
x=96
y=24
sprite=256
grassx=0
grassy=-100
grasstimer=0
grasstimerMax=1000
grass=265
mushx=0
mushy=-100
mushtimer=0
mushtimerMax=1000
mush=284
dandx=0
dandy=-100
dandtimer=0
dandtimerMax=1000
dand=300
dandelions={}
newguy={}
bushx=0
bushy=-100
bushtimer=0
bushtimerMax=1000
bush=312
firex=0
firey=-100
dir=0
-- Bullet
bx=-100; by=-100; bVelX=0; bVelY=0
function getDistance( x1, y1, x2, y2 )
return math.sqrt( ( x2 - x1 )^2 + ( y2 - y1 )^2 )
end
function SpawnDande()
newguy = {}
newguy.x = math.random(20,210)
newguy.y = math.random(20,100)
newguy.sprite = 316
table.insert( dandelions, newguy )
end
function UpdateDande()
for id, obj in pairs( dandelions ) do
-- obj.x, obj.y whatever
end
end
function DrawDande()
for id, obj in pairs( dandelions ) do
spr(obj.sprite, obj.x, obj.y, 0 )
end
end
function TIC()
cls(13)
map(0,0)
spr(bush,bushx-1,bushy+1,0)
spr(bush+1,bushx+1,bushy+1,0)
spr(dand,dandx,dandy, 0)
spr(mush,mushx,mushy, 0)
spr(grass,grassx,grassy, 0)
spr(sprite, x-4,y-4, 0)
spr(sprite+1, x+4,y-4, 0)
spr(sprite+16,x-4,y+4, 0)
spr(sprite+17,x+4,y+4, 0)
spr(262,firex,firey, 0)
if btn(0) then y=y-1;sprite=256;dir=0;pVelX=0;pVelY=-1
elseif btn(1) then y=y+1;sprite=288;dir=1;pVelX=0;pVelY=1
elseif btn(2) then x=x-1;sprite=320;dir=2;pVelX=-1;pVelY=0
elseif btn(3) then x=x+1;sprite=352;dir=3;pVelX=1;pVelY=0
end
if btn(5)and firex==-100 then
-- Put bullet "on" us
firex=x; firey=y
-- Set bullet direction
bVelX=pVelX*2; bVelY = pVelY*2
end
-- Move bullet
if firex ~= -100 then
firex=firex+bVelX
firey=firey+bVelY
end
-- If it goes off screen, disable bullet
if firex < -20 or firex > 240 or firey < -20 or firey > 136 then
firex = -100
end
if x<16 then x=16 end
if y<16 then y=16 end
if y>110 then y=110 end
if x>215 then x=215 end
Randy=math.random(0,50)
if Randy==0 then
grass=265
grassx=math.random(20,210)
grassy=math.random(20,100)
end
dist = getDistance(firex,firey,grassx,grassy)
if dist <= 8 then
grass=267
end
Randy1=math.random(0,50)
if Randy1==0 then
mush=284
mushx=math.random(20,210)
mushy=math.random(20,100)
end
dist = getDistance(firex,firey,mushx,mushy)
if dist <= 8 then
mush=286
end
Randy2=math.random(0,50)
if Randy2==0 then
dand=300
dandx=math.random(20,210)
dandy=math.random(20,100)
end
dist = getDistance(firex,firey,dandx,dandy)
if dist <= 8 then
dand=301
SpawnDande()
UpdateDande()
DrawDande()
end
Randy3=math.random(0,50)
if Randy3==0 then
bush=312
spr(bush,bushx-1,bushy+1,0)
spr(bush+1,bushx+1,bushy+1,0)
bushx=math.random(20,210)
bushy=math.random(20,100)
end
dist = getDistance(firex,firey,bushx,bushy)
if dist <= 8 then
bush=314
spr(bush,bushx-1,bushy+1,0)
spr(bush+1,bushx+1,bushy+1,0)
end
end
--
-- 000:00055000005666000556656056066066000ee00000eee0000eee00000ee00000
-- 005:6666666666666666666666666666666666666666666666666666666666666666
-- 006:66666666666666666666666666666666cc6cc6cccccccccccc6cc6cccc6cc6cc
-- 007:c6666666c6666666c6666666c6666666c6666666c6666666c6666666c6666666
-- 008:04c4444004444c40044444400444444004444c400c44c44004444440044c4440
-- 009:00000000044c444404444444044444c40444444404c44444044c444404444c40
-- 010:04c444404444c44044444c40444444404c444440444444404444c44000000000
-- 016:0000000000000000000000000000000000666600026662600666666666626666
-- 021:6666666666666666666666666666666666666666666666666666666666666666
-- 022:cc6cc6cccccccccccc6cc6cccc6cc6cc66666666666666666666666666666666
-- 023:6666666c6666666c6666666c6666666c6666666c6666666c6666666c6666666c
-- 024:0000000044c444444444444cc444444444c44444444c44c44444444400000000
-- 025:000000004444444044c444404c4444c044444440c44444404444c44004444440
-- 026:04444440044c44440444444c044444440c4444c404444c440444444400000000
-- 053:66666666666666666666666666666666c66666ccc666cccccc6cc6cccc6cc6cc
-- 055:6666666c6666666c6666666c6666666c6665556c6652556c6555552c5255555c
-- 069:66666666666666666666666666666666cc66666ccccc666ccc6cc6cccc6cc6cc
-- 071:c6666666c6666666c6666666c6666666c6655666c6552566c5555556c5255525
-- 072:c6666666c6666666c6666666c6666666c6655666c6555566c5255556c5555525
-- 101:cc6cc6cccc6cc6cccc66ccc6c66cc66666666666666666666666666666666666
-- 102:66666666666666666666666666666666c66cc666cc66ccc6cc6cc6cccc6cc6cc
-- 104:c6666666c666666666666666c6666666c6666666c6666666c666666666666666
-- 106:6666666c6666666c666666666666666c6666666c6666666c6666666c66666666
-- 117:cc6cc6cccc6cc6cc6ccc66cc666cc66c66666666666666666666666666666666
-- 118:66666666666666666666666666666666666cc66c6ccc66cccc6cc6cccc6cc6cc
-- 120:c6666666c6666666c6666666c666666666666666c6666666c6666666c6666666
-- 122:6666666c6666666c6666666c6666666c666666666666666c6666666c6666666c
--
--
-- 000:0000000000000fff0000ffff000effed000dfffd000efffd0000ffed0000ffef
-- 001:00000000fff00000ffff0000deffe000dfffd000dfffe000deff0000feff0000
-- 002:0000000000000fff0000ffff000dffed000efffd000dfffd0000ffed0000ffef
-- 003:00000000fff00000ffff0000deffd000dfffe000dfffd000deff0000feff0000
-- 004:00000344000002340000ff34000effe3000dfffd000efffd0000ffed0000ffed
-- 005:432000004430000043ff00002effe000dfffd000dfffe000deff0000deff0000
-- 006:0000000000030000300230303033334303434343234344433344434203444430
-- 007:0320330033330000444430004433323044443300434330003444430002333000
-- 008:5000000505000050050000500000005000000000050050000505000050000050
-- 009:0050000005000050050005000000050000500000000500000005005050000000
-- 010:e030000e030000e00e0000e0000000e0000000000e00e300030e0000e0000030
-- 011:00e00000030000e00e000e000000030000e00030000e0000000300e0e0000000
-- 012:0000000000212000001410000021200000050000000050000005000000050000
-- 013:030000000020300000343000000e0000000e30000000e000000e0000000e0000
-- 014:000000000000000000000000000000000000000000e00000000e000000ee0e00
-- 016:000fffff000fffff00080000000e0000000e0000000dd000000c0ddd0000cccc
-- 017:fffff000fffff000000080000000e0000000e000000dd000ddd0c000cccc0000
-- 018:000fffff000fffff00080000000e0000000e0000000dd000000c0ddd0000cccc
-- 019:fffff000fffff000000080000000e0000000e000000dd000ddd0c000cccc0000
-- 020:000fffff000fffff00080000000e0000000e0000000dd000000c0ddd0000cccc
-- 021:fffff000fffff000000080000000e0000000e000000dd000ddd0c000cccc0000
-- 022:0344443024344433344434323434343034333303030320030000300000000000
-- 023:0003332000344443000334340033444403233344000344440000333300330230
-- 024:0050000005000005050000050000000000000000000050000000050000000500
-- 025:0000005050505005050005050000050000000500000000000500505005000500
-- 026:00e000000300000e0e00000e00000030003000000000e0000000030000000e00
-- 027:000000e030e0e0030e00030e00000e0000000e00000000000300e0e00e000300
-- 028:00000000000000000002c0000022cc000cc222c0000440000004400000444400
-- 029:00000000200300303423443003443c200ccdd3c0000ee000000ee00000eeee00
-- 030:0000000000000000000000e00000000000e000000000e000000e000000eee000
-- 032:0000cccc000c0ddd000dd000000e0000000e000000080000000fffff000fffff
-- 033:cccc0000ddd0c000000dd0000000e0000000e00000008000fffff000fffff000
-- 044:0000000000ccc00000ccc00000ccc00000050000000050000005000000050000
-- 045:00c00c00000000c00c32300000040000c00e30c00000e000000e0000000e0000
-- 048:0000ffef0000ffed000efffd000dfffd000effed0000ffff00000fff00000000
-- 049:feff0000deff0000dfffe000dfffd000deffe000ffff0000fff0000000000000
-- 056:0000000000000000000000050000550500055555000255550055555505555525
-- 057:0555000055555000555525005555550025555550555552505555555055255550
-- 058:03030300002303030033344400024434000343e400033eee00e3eeee0eeefeef
-- 059:3030330020244230444433004434443034334430333344e0eeee3ee0eeeefee0
-- 060:000000000000000000000000000c000000000000000000000000000000000000
-- 061:0000000000000000000c000000ccc000000c0000000050000005000000050000
-- 064:000000000000000000000000000ede0000ffffff0fffffff0ffeffee0ffddddf
-- 065:000000000000000000000000ff8eedc0ff000d0cff0000dcff0000dcff0000dc
-- 080:0ffddddf0ffeffee0fffffff00ffffff000ede00000000000000000000000000
-- 081:ff0000dcff0000dcff0000dcff000d0cff8eedc0000000000000000000000000
-- 096:0000000000000000000000000cdee8ffc0d000ffcd0000ffcd0000ffcd0000ff
-- 097:00000000000000000000000000ede000ffffff00fffffff0eeffeff0fddddff0
-- 112:cd0000ffcd0000ffcd0000ffc0d000ff0cdee8ff000000000000000000000000
-- 113:fddddff0eeffeff0fffffff0ffffff0000ede000000000000000000000000000
--
--
--
-- 000:00000000ffffffff00000000ffffffff
-- 001:0123456789abcdeffedcba9876543210
-- 002:0123456789abcdef0123456789abcdef
--
--
-- 000:0110213031504164417451806190719071ae51a041a021a021a02190219021863170417051605160515d5150415031502164216021701170117e1180304000000000
--
--
-- 000:400006500006600006800006700006600006700006600006500006400006400006000000400006500006600006a00006b00006a00006900006700006600006600006e00006e00006d00006000000000000400006600006900006800006700006000000700006900006b00006d00006c00006d00006b00006900006700006500006400006400004000000000000400004000000500004800004700004000000600004000000800004400006500006700006600006000000500006000000400006
--
--
-- 000:100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ab0000
--
--
-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
--