55 lines
1.6 KiB
Lua
55 lines
1.6 KiB
Lua
local logging = require "modules.logging"
|
|
---@type engine.module
|
|
local module = {}
|
|
|
|
local explosion
|
|
|
|
function module.onCreate()
|
|
explosion = Sprite("images/blazin/SpraypaintExplosion.png","images/blazin/SpraypaintExplosion.xml")
|
|
|
|
explosion.layer = 10.5
|
|
explosion.position = Vector2()
|
|
explosion.alpha = 0
|
|
end
|
|
|
|
function module.noteHit(note)
|
|
--print(note, logging.dump(note.raw))
|
|
if note.raw.k == "weekend-1-cockgun" then
|
|
sharedVars.characters.bf:PlayAnimation("cock")
|
|
print("cock")
|
|
elseif note.raw.k == "weekend-1-kneecan" then
|
|
sharedVars.characters.bf:PlayAnimation("CanHit")
|
|
elseif note.raw.k == "weekend-1-firegun" then
|
|
sharedVars.characters.bf:PlayAnimation("shoot")
|
|
evilcan:PlayAnimation("Can Shot")
|
|
evilcan.position = Vector2(10000, 100000)
|
|
explosion.alpha = 1
|
|
explosion:PlayAnimation("Explosion 1 movie", 24, false)
|
|
|
|
print("shoot")
|
|
end
|
|
end
|
|
|
|
function module.onMiss(note)
|
|
if note.raw.k == "weekend-1-cockgun" or note.raw.k == "weekend-1-firegun" then
|
|
sharedVars.health = 0
|
|
print("missed")
|
|
end
|
|
end
|
|
|
|
function module.opponentNoteHit(note)
|
|
if note.raw.k == "weekend-1-lightcan" then
|
|
sharedVars.characters.dad:PlayAnimation("lightCan")
|
|
elseif note.raw.k == "weekend-1-kickcan" then
|
|
sharedVars.characters.dad:PlayAnimation("kickCan")
|
|
evilcan:PlayAnimation("Can Start")
|
|
evilcan.position = Vector2(500, 700)
|
|
evilcan.alpha = 1
|
|
end
|
|
end
|
|
|
|
function module.onUpdate()
|
|
if explosion and explosion.ended then explosion.alpha = 0 end
|
|
end
|
|
|
|
return module |