Cacos interdimensionals done!
This commit is contained in:
@@ -16,12 +16,12 @@ function warp.init()
|
||||
draw.surfrot(sprite_x, sprite_y, 16, 16, 0, 15, 270)
|
||||
end
|
||||
|
||||
function warp.new(world_x, world_y)
|
||||
function warp.new(_actor)
|
||||
-- local world_x, world_y = coords.room_to_world(_hab,_x,_y)
|
||||
return {name="warp",
|
||||
hab=_hab,
|
||||
x=world_x,
|
||||
y=world_y,
|
||||
x=_actor.x,
|
||||
y=_actor.y,
|
||||
w=arcade_config.sprite_size.w,
|
||||
h=arcade_config.sprite_size.h,
|
||||
frame=0,
|
||||
@@ -31,7 +31,8 @@ function warp.new(world_x, world_y)
|
||||
d_angle=5,
|
||||
update=warp.update,
|
||||
draw=warp.draw,
|
||||
alive=true}
|
||||
alive=true,
|
||||
actor=_actor}
|
||||
end
|
||||
|
||||
function warp:draw()
|
||||
@@ -44,6 +45,7 @@ function warp:draw()
|
||||
end
|
||||
|
||||
function warp:update()
|
||||
if not self.actor.warping then self.alive=false end
|
||||
if not self.alive then return end
|
||||
self.wait=self.wait+1
|
||||
self.angle=self.angle+self.d_angle
|
||||
@@ -59,20 +61,20 @@ function warp:update()
|
||||
if self.angle>=360 then self.angle=self.angle % 360 end
|
||||
end
|
||||
|
||||
function warp.open(world_x,world_y)
|
||||
function warp.open(actor)
|
||||
for _, w in ipairs(warp.warp_list) do
|
||||
if not w.alive then
|
||||
w.alive = true
|
||||
w.x = world_x
|
||||
w.y = world_y
|
||||
w.x = actor.x
|
||||
w.y = actor.y
|
||||
w.actor = actor
|
||||
return e; -- reutilitzar
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(warp.warp_list, warp.new(world_x, world_y) )
|
||||
table.insert(warp.warp_list, warp.new(actor) )
|
||||
end
|
||||
|
||||
|
||||
function warp.update_all()
|
||||
for _, w in ipairs(warp.warp_list) do
|
||||
if w.alive then
|
||||
|
||||
Reference in New Issue
Block a user