[WIP] Treballant en el jefe. Super!

This commit is contained in:
2026-04-17 23:49:16 +02:00
parent 1b3aa47d9e
commit 5843953b7b
2 changed files with 104 additions and 24 deletions

View File

@@ -34,7 +34,7 @@ function imp.new(_hab,_x,_y)
step=0,
moods={stop=0, chase=1, avoid=2, neutral=4},
mood=0, --anterior fight_mode
timers={mood=150,target=100, shot=100, super=200, flip_wait=50}, --anterior *_cooldown
timers={mood=150,target=350, shot=100, super=200, super_wait=200, flip_wait=50, stucked_locked=50}, --anterior *_cooldown
move_types={free=0, pattern=1, super=2},
move_type=1, -- anterior movement_type
actions={no_action=0, up=1, down=2, left=4, right=8, jump=16, shot=32, super=64, jumpfwd=128},
@@ -50,6 +50,11 @@ function imp.new(_hab,_x,_y)
action_event = {},
action = 0,
old_action = 0,
stucked = {x=0, y=0, t=0 },
invencible = false,
zoom = 1,
super_pal={[13]=13,[14]=14,[15]=15},
super_fired = false,
--
moure = noop,
draw=imp.draw,
@@ -75,6 +80,8 @@ function imp.new(_hab,_x,_y)
add_action_event = imp.add_action_event,
shot = imp.shot,
pattern_recovery = imp.pattern_recovery,
super = imp.super,
super_movement = imp.super_movement,
-- debug
_moure = imp._moure,
_pause = false,
@@ -86,11 +93,11 @@ function imp:draw() --OK
local scr_x, scr_y = viewp:screen_coords( self.x, self.y )
-- Modo super
if self.moure==self.state_super then
if self.moure==imp.state_super then
-- rotar paleta
for col=13,15 do
local newc = self.super_pal[col]
if self.super_wait%6 == 0 then
if self.timers.super_wait%6 == 0 then
newc = newc+1
if newc>15 then newc=13 end
end
@@ -184,7 +191,14 @@ function imp:update_normal()
-- moviment
self:controller_input()
self:moure()
-- Que no conte si està en modo Super
if self.stucked.x == self.x and self.stucked.y == self.y then
self.stucked.t = self.stucked.t + 1
else
self.stucked.x = self.x
self.stucked.y = self.y
self.stucked.t = 0
end
-- Logica per a selecció de frame
self:next_frame()
end