- [FIX] Al canviar d'habitació cap a baix se rallaba

- [FIX] Al pulsar la majoria de botons en el menu, fa la acció i tanca el menú automàticament
- [FIX] Ajustada la posició d'inici de l'heroi
- [FIX] Arreglat bug raro que quan pillaves una moneda algunes momies canviaven de direcció
- [WIP] Reajustant els tiles de les habitacions al nou tamany
This commit is contained in:
2026-03-11 10:59:59 +01:00
parent 40c3dcd6d0
commit 333d05dfac
8 changed files with 22 additions and 13 deletions

View File

@@ -77,7 +77,7 @@ game = {
game.chg_step = 8*4
sprites.pause_ia = true
-- [TODO] Crear els sprites per als items de l'habitació a la que entrem
sprites.add_from_room(rooms.pos.x+x*20, rooms.pos.y+y*12)
sprites.add_from_room(rooms.pos.x+x*20, rooms.pos.y+y*13)
app.push(game.update_change_room)
--sys.beat(10)
end,
@@ -94,7 +94,7 @@ game = {
-- Pintar el mapa i sprites
rooms.pos.x = rooms.pos.x + (game.chg_adv.x*2.5)
rooms.pos.y = rooms.pos.y + (game.chg_adv.y*1.5)
rooms.pos.y = rooms.pos.y + (game.chg_adv.y*1.625)
sprites.hero.pos.x = sprites.hero.pos.x + game.chg_adv.x
sprites.hero.pos.y = sprites.hero.pos.y + game.chg_adv.y

View File

@@ -8,12 +8,12 @@ menu = {
draw = function()
actions = {
editor.play,
function() rooms.save() editor.modified=false end,
editor.quit,
function() editor.layer=LAYER_FOREGROUND end,
function() editor.layer=LAYER_BACKGROUND end,
function() editor.layer=LAYER_ITEMS end,
function() editor.play() menu.close() end,
function() rooms.save() editor.modified=false menu.close() end,
function() editor.quit() menu.close() end,
function() editor.layer=LAYER_FOREGROUND menu.close() end,
function() editor.layer=LAYER_BACKGROUND menu.close() end,
function() editor.layer=LAYER_ITEMS menu.close() end,
function() rooms.toggle_visibility(LAYER_FOREGROUND) end,
function() rooms.toggle_visibility(LAYER_BACKGROUND) end,
function() rooms.toggle_visibility(LAYER_SHADOWS) end,
@@ -82,6 +82,13 @@ menu = {
end
end,
close = function()
if not menu.hidden then
menu.hidden = true
tweening.add(24,0,0.25,easing.easeOutBounce,function(value,n,finished)menu.pos_y=value end)
end
end,
-- current_x = 0,
--
-- init = function()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -20,7 +20,7 @@ score = {
end,
inc = function(value)
print("score.inc()")
--print("score.inc()")
score.points = score.points + value
tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) score.color = (math.floor(val)&1) == 0 and 28 or 14 end)
end

View File

@@ -48,7 +48,7 @@ sprites = {
init = function()
sprites.hero = {
type = "hero",
pos = { x=28, y=4*13*8+71 },
pos = { x=28, y=4*13*8+79 },
size= { w=16, h=17 },
bbo = { left=3, top=2, right=3, bottom=0 },
current_frame = 1,
@@ -196,6 +196,7 @@ sprites = {
end,
update_mummy = function(spr)
map.surf(rooms.surf_foreground)
if spr.state == templates.ALIVE then
if sprites.hero.state == templates.ALIVE then
local x1,y1,w1,h1 = util.aabb(spr) -- El meu aabb
@@ -377,7 +378,7 @@ sprites = {
local tile_under_me1 = map.tile(tx1,ty+2)
local tile_under_me2 = map.tile(tx2,ty+2)
if tile_under_me1 == 0 and tile_under_me2 == 0 then
if rooms.pos.y<84 and ty+2>rooms.pos.y+11 then
if rooms.pos.y<84 and ty+2>rooms.pos.y+12 then
game.change_room(0,1)
else
if sprites.hero.cooldown % 4 == 0 then
@@ -471,7 +472,7 @@ sprites = {
anim = move_anim
local tx1, tx2, ty = (sprites.hero.pos.x+4)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y+1)>>3
if map.tile(tx1,ty+2) < 16 or map.tile(tx2,ty+2) < 16 then
if ty+2>rooms.pos.y+11 then
if ty+2>rooms.pos.y+12 then
game.change_room(0,1)
else
sprites.hero.pos.y = sprites.hero.pos.y + 1
@@ -485,7 +486,7 @@ sprites = {
local tile_under_me1 = map.tile(tx1,ty+2)
local tile_under_me2 = map.tile(tx2,ty+2)
if tile_under_me1 == 0 and tile_under_me2 == 0 then
if rooms.pos.y<84 and ty+2>rooms.pos.y+11 then
if rooms.pos.y<84 and ty+2>rooms.pos.y+12 then
game.change_room(0,1)
else
if sprites.hero.pos.y >= 808 then

View File

@@ -49,6 +49,7 @@ templates = {
surf = surf.load("misc.gif"),
animation = "coin",
state = templates.ALIVE,
timer = 0,
light = 15,
light_ox = 4,
light_oy = 4,