opening anim looking good

This commit is contained in:
James Turk 2023-04-25 00:22:24 -05:00
parent e032558e06
commit 6769ff9e60
2 changed files with 80 additions and 41 deletions

View File

@ -61,6 +61,7 @@ function draw_dusk()
-- trick: make other fill transparent
fillp(0b1010010110100101.1)
rectfill(0, 50, 128, 60, 9)
fillp(0)
end
function draw_explainer()
@ -69,38 +70,73 @@ function draw_explainer()
local st = scene_time()
local bcolors = {8, 9, 10}
local bcolor = bcolors[flr(5*t()%3)+1]
print("in 1978, eddie boyman was \n involved in an accident.", 0, 80, 7)
if st > 2 then
if st < 1 then
print("3", 80, 25, 7)
elseif st < 2 then
print("2", 80, 25, 7)
elseif st < 3 then
print("1", 80, 25, 7)
elseif st < 4 then
print("WATCH OUT!", 40, 15, 7)
end
print("in 1978, eddie boyman was \n involved in an accident.", 10, 80, 7)
if st > 4 then
print("\nas a bystander of a \n failed nasa experiment")
end
if st > 6 then
print("he became...", 10, 118)
end
if st > 7 then
print("a bomb", 60, 118, bcolor)
print("he became...", 20, 118)
end
if st > 10 then
print("a bomb", 70, 118, bcolor)
end
if st > 3 and st < 6 then
draw_beam()
end
draw_sprite(exp_spr)
end
function draw_beam()
-- only lime thing
palt(11, false)
local x=30
local y=66
line(x, 0, x, y, 11)
local v = 9*t() % 3
oval(x-(3+v), y-(2+v), x+4+v, y+2+v, 11)
palt(11, true)
--oval(x-(6+v), y-(4+v), x+6+v, y+4+v, 11)
end
function update_explainer()
update_sprite(exp_spr)
if exp_spr.speed == 0 then
if exp_phase == "boy" then
exp_spr = make_sprite(50, 50, "boy_bomb", 0.4)
exp_phase = "boy_bomb"
elseif exp_phase == "boy_bomb" then
exp_spr = make_sprite(50, 50, "bomb_s", 0.1)
exp_phase = "bomb_s"
elseif exp_phase == "bomb_s" then
exp_spr = make_sprite(50, 50, "bomb_m", 0.1)
exp_phase = "bomb_m"
end
local st = scene_time()
if exp_phase == "boy" and exp_spr.x >= 20 then
exp_spr.x = 20
exp_spr.vx = 0
exp_spr.speed = 0
end
if exp_phase == "boy" and st > 5 then
exp_spr = make_sprite(20, exp_spr.y, "boy_bomb", 0.4)
exp_phase = "boy_bomb"
end
if exp_phase == "boy_bomb" and st > 9 then
exp_spr = make_sprite(20, exp_spr.y+8, "bomb_s", 0.1)
exp_phase = "bomb_s"
end
if exp_phase == "bomb_s" and st > 11 then
exp_spr = make_sprite(20, exp_spr.y-8, "bomb_m", 0.1)
exp_phase = "bomb_m"
end
end
function start_explainer()
exp_spr = make_sprite(20, 20, "boy_walk", 0.2)
exp_spr = make_sprite(-10, 50, "boy_walk", 0.2)
exp_spr.loop = true
exp_spr.vx = .3
exp_spr.vy = .02
exp_phase = "boy"
end
@ -182,14 +218,14 @@ cc77cc77bbbb55555555bbbbbbbbbbbb555555555654456555444455c4ffff47c5665657c53ea157
77cc77ccbbbb55555555bbbb55555555bbbbbbbb55555555b544445b74ffff4c7566555c7555555c7444444c74363f4c55555555000000000000000000000000
cc77cc77bbbb55555555bbbb55555555bbbbbbbbb556655bbbbbbbbbc4ffff47c5555557c5555557c4444447c4363f4755555555000000000000000000000000
cc77cc77bbbb55555555bbbb55555555bbbbbbbb6b5555b6bbbbbbbbc4444447cc77cc77cc77cc77cc444477c4444447c5555557000000000000000000000000
bbbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbbbb444bbbb4444888bbbbbbbbbb0000000000000000000000000000000000000000000000000000000000000000
bbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbb447774bbbb4ee44444444bbbbbb0000000000000000000000000000000000000000000000000000000000000000
bbb88bb88bb888bb88bb5bbb888bbbbbbbb44ee747488bb777e47474448bbbbb0000000000000000000000000000000000000000000000000000000000000000
bbb888b88b88888b88888bb88888bbbbbbb844e777748b874744747e4488bbbb0000000000000000000000000000000000000000000000000000000000000000
bbb888888b88b88bbbbb88b88b88bbbbbbb884e74d74b887774447e44488bbbb0000000000000000000000000000000000000000000000000000000000000000
bbb88b888b88888bb88888b88888bbbbbbb884477774b84444e77444448bbbbb0000000000000000000000000000000000000000000000000000000000000000
bbb88bb88b88b88b88885bb88b88bbbbbbb88b448b88b844444444b88bbbbbbb0000000000000000000000000000000000000000000000000000000000000000
bbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbbbbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbb0000000000000000000000000000000000000000000000000000000000000000
bbbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbbbb444bbbb4444888bbbbbbbbbb0000000044444444000000000000000000000000000000000000000000000000
bbbbbbbbbbbbbbbbb8888bbbbbbbbbbbbbbbb447774bbbb4ee44444444bbbbbb0000000044ffff44000000000000000000000000000000000000000000000000
bbb88bb88bb888bb88bb5bbb888bbbbbbbb44ee747488bb777e47474448bbbbb000000004f4ff4f4000000000000000000000000000000000000000000000000
bbb888b88b88888b88888bb88888bbbbbbb844e777748b874744747e4488bbbb000000004ff44ff4000000000000000000000000000000000000000000000000
bbb888888b88b88bbbbb88b88b88bbbbbbb884e74d74b887774447e44488bbbb000000004ff44ff4000000000000000000000000000000000000000000000000
bbb88b888b88888bb88888b88888bbbbbbb884477774b84444e77444448bbbbb000000004f4ff4f4000000000000000000000000000000000000000000000000
bbb88bb88b88b88b88885bb88b88bbbbbbb88b448b88b844444444b88bbbbbbb0000000044ffff44000000000000000000000000000000000000000000000000
bbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbbbbb5bbb5bb5bbb5bbb5b5bb5bbb5bbbb0000000044444444000000000000000000000000000000000000000000000000
bb6666666666666666666666666666bbbb666666666666666666666666b5bbbb0000000000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb666666666666666666666666665bbb0000000000000000000000000000000000000000000000000000000000000000
bb66c6c6c6c6c6c66c6c6c6c6c6c66bbbb66c646c6c6c6c6646c6c6c6b6b6bbb0000000000000000000000000000000000000000000000000000000000000000
@ -206,22 +242,22 @@ bb6666666666666666666666666666bbbb66c6c6c646c6c66c6c6c646c6c66bb0000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
66666666666666660000000000000000000000000000000000000000000000006666666600000000000000000000000000000000000000000000000000000000
33333333333333330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333335335330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333333533530000000000000000000000000000000000000000000000000aa00aa000000000000000000000000000000000000000000000000000000000
33333333333533530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333335335330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333353353330000000000000000000000000000000000000000000000006666666600000000000000000000000000000000000000000000000000000000
33333333353353330000000000000000000000000000000000000000000000003333333300000000000000000000000000000000000000000000000000000000
66666666666666663333333300000000000000000000000000000000000000006666666600000000000000000000000000000000000000000000000000000000
33333333333333333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333335335333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333333533533333333300000000000000000000000000000000000000000aa00aa000000000000000000000000000000000000000000000000000000000
33333333333533533333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333335335333333333300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33333333353353333333333300000000000000000000000000000000000000006666666600000000000000000000000000000000000000000000000000000000
33333333353353333333333300000000000000000000000000000000000000003333333300000000000000000000000000000000000000000000000000000000
__map__
0000008081828300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000009091929300000000000000000000000000000084858687000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000009091929300000000000000000000000000000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000009091929300000000000000000000000000000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000009091929300000000000000000000000000000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
b8b8b8b8b8b8b8b8b8b8b8b8b8b8b8b80000000000b8b8b8b8b8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b00000000000b0b0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000008081828380818200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000070000009091929390919200000084858687000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000b170a00009091929390919200000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000061b891a08009091929390919200000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000001689898918009091929390919200000090919293000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
b2b2b2b2b2b2b2b2b2b8b8b8b8b8b8b80000000000b8b8b8b8b8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
b2b2b2b2b2b2b2b2b2b0b0b0b0b0b0b00000000000b0b0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

View File

@ -1,6 +1,7 @@
function make_sprite(x, y, anim, speed)
s = {
x=x, y=y, anim=animations[anim], speed=speed,
vx=0, vy=0,
frame=0, last_update=t(),
flip_x=false, flip_y=false, loop=false,
}
@ -13,6 +14,8 @@ function update_sprite(s)
s.last_update = now
return
end
s.x += s.vx
s.y += s.vy
if s.speed != 0 then
if now - s.last_update > s.speed then
s.frame += 1