Compare commits
No commits in common. "main" and "trigenometry_gun" have entirely different histories.
main
...
trigenomet
@ -169,6 +169,8 @@ function wipe_game()
|
|||||||
xpwhoosh = nil
|
xpwhoosh = nil
|
||||||
primary_ship = player.new()
|
primary_ship = player.new()
|
||||||
init_hpcols()
|
init_hpcols()
|
||||||
|
pships = linked_list.new()
|
||||||
|
pships:push_back(primary_ship)
|
||||||
eships = linked_list.new()
|
eships = linked_list.new()
|
||||||
pbullets = linked_list.new()
|
pbullets = linked_list.new()
|
||||||
ebullets = linked_list.new()
|
ebullets = linked_list.new()
|
||||||
@ -206,8 +208,7 @@ function ones(n)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function updategame()
|
function updategame()
|
||||||
local ps = primary_ship
|
if (primary_ship.xp >= primary_ship.xptarget) and (gframe - primary_ship.last_xp_frame > 0x0.000f) and (not primary_ship.dead) then
|
||||||
if (ps.xp >= ps.xptarget) and (gframe - ps.last_xp_frame > 0x0.000f) and (not ps.dead) then
|
|
||||||
mode = rearm_mode.new()
|
mode = rearm_mode.new()
|
||||||
return _update60()
|
return _update60()
|
||||||
end
|
end
|
||||||
@ -237,24 +238,36 @@ function updategame()
|
|||||||
end
|
end
|
||||||
events:vore(new_events)
|
events:vore(new_events)
|
||||||
events:strip(call_move)
|
events:strip(call_move)
|
||||||
for _, lst in ipairs{intangibles_bg, eships, pbullets, ebullets} do
|
for _, lst in ipairs{intangibles_bg, pships, eships, pbullets, ebullets} do
|
||||||
lst:strip(call_move)
|
lst:strip(call_move)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ps.dead then
|
pships:strip(
|
||||||
ps:move()
|
function(ps)
|
||||||
local pbox = hurtbox(ps)
|
local pbox, pded = hurtbox(ps), false
|
||||||
eships:strip(function(es)
|
eships:strip(
|
||||||
if(not collides(pbox, hurtbox(es))) return
|
function(es)
|
||||||
ps:hitship(es)
|
if (not collides(pbox, hurtbox(es))) return
|
||||||
|
pded = pded or ps:hitship(es)
|
||||||
return es:hitship(ps)
|
return es:hitship(ps)
|
||||||
end)
|
|
||||||
ebullets:strip(function(eb)
|
|
||||||
if (not collides(pbox, hurtbox(eb))) return
|
|
||||||
ps:hitbullet(eb)
|
|
||||||
return eb:hitship(ps)
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
)
|
||||||
|
return pded
|
||||||
|
end
|
||||||
|
)
|
||||||
|
pships:strip(
|
||||||
|
function(ps)
|
||||||
|
local pbox, pded = hurtbox(ps), false
|
||||||
|
ebullets:strip(
|
||||||
|
function(eb)
|
||||||
|
if (not collides(pbox, hurtbox(eb))) return
|
||||||
|
pded = pded or ps:hitbullet(eb)
|
||||||
|
return eb:hitship(ps)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
return pded
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
-- many bullets and many enemy ships;
|
-- many bullets and many enemy ships;
|
||||||
-- use bucket collider for efficiency
|
-- use bucket collider for efficiency
|
||||||
@ -289,9 +302,9 @@ function updategame()
|
|||||||
if waves_complete == 32767 and not eships.next and not ebullets.next and not events.next then
|
if waves_complete == 32767 and not eships.next and not ebullets.next and not events.next then
|
||||||
game_state = win
|
game_state = win
|
||||||
end
|
end
|
||||||
if (ps.dead) game_state = lose
|
if (not pships.next) game_state = lose
|
||||||
|
|
||||||
if ps.xp >= ps.xptarget then
|
if primary_ship.xp >= primary_ship.xptarget then
|
||||||
if not xpwhoosh then
|
if not xpwhoosh then
|
||||||
xpwhoosh = 0
|
xpwhoosh = 0
|
||||||
else
|
else
|
||||||
@ -380,8 +393,8 @@ end
|
|||||||
function drawgame()
|
function drawgame()
|
||||||
clip(0,0,112,128)
|
clip(0,0,112,128)
|
||||||
rectfill(0,0,112,128,0)
|
rectfill(0,0,112,128,0)
|
||||||
for drawable in all{intangibles_bg, pbullets, primary_ship, eships, ebullets, intangibles_fg} do
|
for slist in all{intangibles_bg, pbullets, pships, eships, ebullets, intangibles_fg} do
|
||||||
drawable:draw()
|
slist:draw()
|
||||||
end
|
end
|
||||||
clip(0,0,128,128)
|
clip(0,0,128,128)
|
||||||
drawhud()
|
drawhud()
|
||||||
@ -611,7 +624,6 @@ function ship_m:move()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ship_m:draw()
|
function ship_m:draw()
|
||||||
if (self.dead) return
|
|
||||||
if(self.fx_pal) pal(self.fx_pal)
|
if(self.fx_pal) pal(self.fx_pal)
|
||||||
spr(self.sprite, self.x, self.y, self.size, self.size)
|
spr(self.sprite, self.x, self.y, self.size, self.size)
|
||||||
pal()
|
pal()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user