diff --git a/data/game.lua b/data/game.lua index 285e6cf..0cf1562 100644 --- a/data/game.lua +++ b/data/game.lua @@ -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 diff --git a/data/menu.lua b/data/menu.lua index a70f685..d64971b 100644 --- a/data/menu.lua +++ b/data/menu.lua @@ -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() diff --git a/data/rooms_background.gif b/data/rooms_background.gif index b962bd1..7b9ff16 100644 Binary files a/data/rooms_background.gif and b/data/rooms_background.gif differ diff --git a/data/rooms_foreground.gif b/data/rooms_foreground.gif index 0d21bba..e8b5470 100644 Binary files a/data/rooms_foreground.gif and b/data/rooms_foreground.gif differ diff --git a/data/rooms_items.gif b/data/rooms_items.gif index f630ba0..c6fb25b 100644 Binary files a/data/rooms_items.gif and b/data/rooms_items.gif differ diff --git a/data/score.lua b/data/score.lua index 04ba6fa..bd0b03c 100644 --- a/data/score.lua +++ b/data/score.lua @@ -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 diff --git a/data/sprites.lua b/data/sprites.lua index 62970ba..5728da9 100644 --- a/data/sprites.lua +++ b/data/sprites.lua @@ -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 diff --git a/data/templates.lua b/data/templates.lua index 20a8a35..dc71213 100644 --- a/data/templates.lua +++ b/data/templates.lua @@ -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,