Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Oct 12, 2024
1 parent 1fad7c3 commit 0e8048a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ engine:prefetch({
engine:set_scene("ship")

local postal = PostalService.new()
local timemanager = TimeManager.new()
local soundmanager = engine:soundmanager()
local octopus = engine:spawn("octopus")
local player = engine:spawn("player")
Expand Down Expand Up @@ -79,6 +80,27 @@ octopus:on_mail(function(self, message)
life = life - 1
if life <= 0 then
self:set_action("dead")

timemanager:set(3000, function(id)
print("on timer...")
timemanager:clear(id)

local function destroy(pool)
for i = #pool, 1, -1 do
engine:destroy(pool[i])
table.remove(pool, i)
end
end

destroy(bullet_pool)
destroy(explosion_pool)

engine:destroy(octopus)
engine:destroy(player)
engine:destroy(princess)
engine:destroy(candle1)
engine:destroy(candle2)
end)
end
end
end)
Expand Down

0 comments on commit 0e8048a

Please sign in to comment.