[WIP] Enviant als cacos a altra dimensió

[NEW] Tile per a warping
This commit is contained in:
2026-03-30 21:46:30 +02:00
parent 9e9a60b733
commit c9a4313e04
5 changed files with 229 additions and 33 deletions

View File

@@ -23,8 +23,6 @@ local view_checking_tile = false
viewp = viewport.new(arcade_config.resolucion.width, arcade_config.resolucion.height)
viewp:position(0,0)
local warp_rot = 0
actors={}
function game_init(menu)
@@ -89,7 +87,7 @@ function game_init(menu)
abad_make_safe( true )
local scr_ax, scr_ay = viewp:screen_coords(abad_x, abad_y)
game_update=update_game
end
@@ -187,6 +185,7 @@ function update_game()
if cacau_shot.alive and collision(actor,cacau_shot) then
if actor.hit ~= nil then
actor:hit()
warp.open(actor.x, actor.y)
cacau:kill(cacau_shot)
end
end
@@ -196,6 +195,7 @@ function update_game()
cacau.update()
switches.update()
warp.update_all()
-- Moure el viewport
local vp_x = viewp.x
@@ -216,22 +216,22 @@ function update_game()
-- Pintar la finestra del mon
render_map(sf_mapa, tiles, vp_x, vp_y)
for key,warp in pairs(warp.warp_list) do
if viewp:inside(warp.x, warp.y, warp.w, warp.h) then
warp:draw()
end
end
for key,actor in pairs(actors) do
if viewp:inside(actor.x, actor.y, actor.w, actor.h) then
actor:draw()
end
end
cacau:draw()
score.draw()
-- Proves de warp
surf.source(warp)
-- draw.surf(0,0,32,32,0,0)
draw.surfrot(0,0,32,32,0,0,warp_rot)
warp_rot=warp_rot+5
if warp_rot>=360 then warp_rot=0 end
fps_print()
-- viewp:print()
-- msg_print(0,14,"ABAD= "..abad.x..", "..abad.y, true)