Zombies interdimensionals done!
This commit is contained in:
@@ -23,6 +23,63 @@ local view_checking_tile = false
|
||||
viewp = viewport.new(arcade_config.resolucion.width, arcade_config.resolucion.height)
|
||||
viewp:position(0,0)
|
||||
|
||||
function actor_warp_draw(actor)
|
||||
local shrink_w = actor.w*actor.shrink
|
||||
local shrink_h = actor.h*actor.shrink
|
||||
local offset_x = math.floor((actor.w-shrink_w)/2)
|
||||
local offset_y = math.floor((actor.h-shrink_h)/2)
|
||||
local scr_x, scr_y = viewp:screen_coords( actor.x+offset_x, actor.y+offset_y )
|
||||
shrink_w = math.floor(shrink_w)
|
||||
shrink_h = math.floor(shrink_h)
|
||||
|
||||
if shrink_w>0 and shrink_h>0 then
|
||||
draw.surfrot((actor.frame&7)*cw, (actor.frame>>cxr2)*ch,
|
||||
cw, ch,
|
||||
scr_x, scr_y,
|
||||
actor.angle,
|
||||
shrink_w, shrink_h,
|
||||
actor.flip)
|
||||
end
|
||||
end
|
||||
|
||||
function actor_warp_update(actor)
|
||||
-- warp, wait, respawn
|
||||
if actor.warping then
|
||||
if actor.step<actor.death_time then
|
||||
actor.shrink=actor.shrink-actor.d_shrink
|
||||
actor.angle=actor.angle+actor.d_angle
|
||||
if actor.angle>=360 then actor.angle = actor.angle % 360 end
|
||||
if actor.shrink<=0 then
|
||||
actor.shrink=1
|
||||
actor.d_shrink=1
|
||||
actor.angle=0
|
||||
actor.d_angle=1
|
||||
actor.warping = false
|
||||
actor.frame = -1
|
||||
actor.step = 0
|
||||
end
|
||||
end
|
||||
elseif actor.step<actor.death_time/2 then
|
||||
actor.frame = -1
|
||||
elseif actor.step<actor.death_time then
|
||||
if actor.step%2==0 then
|
||||
actor.frame=actor.anim[4]
|
||||
else
|
||||
actor.frame=-1
|
||||
end
|
||||
elseif actor.step>=actor.death_time then
|
||||
actor.frame=actor.anim[1]
|
||||
actor.step=0
|
||||
actor.wait=0
|
||||
if actor.name=="caco" then
|
||||
actor.update=caco.update_normal
|
||||
elseif actor.name=="zombie" then
|
||||
actor.update=zombie.update_normal
|
||||
end
|
||||
actor.dying = false
|
||||
end
|
||||
end
|
||||
|
||||
actors={}
|
||||
|
||||
function game_init(menu)
|
||||
|
||||
Reference in New Issue
Block a user