- [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:
@@ -77,7 +77,7 @@ game = {
|
|||||||
game.chg_step = 8*4
|
game.chg_step = 8*4
|
||||||
sprites.pause_ia = true
|
sprites.pause_ia = true
|
||||||
-- [TODO] Crear els sprites per als items de l'habitació a la que entrem
|
-- [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)
|
app.push(game.update_change_room)
|
||||||
--sys.beat(10)
|
--sys.beat(10)
|
||||||
end,
|
end,
|
||||||
@@ -94,7 +94,7 @@ game = {
|
|||||||
|
|
||||||
-- Pintar el mapa i sprites
|
-- Pintar el mapa i sprites
|
||||||
rooms.pos.x = rooms.pos.x + (game.chg_adv.x*2.5)
|
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.x = sprites.hero.pos.x + game.chg_adv.x
|
||||||
sprites.hero.pos.y = sprites.hero.pos.y + game.chg_adv.y
|
sprites.hero.pos.y = sprites.hero.pos.y + game.chg_adv.y
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ menu = {
|
|||||||
|
|
||||||
draw = function()
|
draw = function()
|
||||||
actions = {
|
actions = {
|
||||||
editor.play,
|
function() editor.play() menu.close() end,
|
||||||
function() rooms.save() editor.modified=false end,
|
function() rooms.save() editor.modified=false menu.close() end,
|
||||||
editor.quit,
|
function() editor.quit() menu.close() end,
|
||||||
function() editor.layer=LAYER_FOREGROUND end,
|
function() editor.layer=LAYER_FOREGROUND menu.close() end,
|
||||||
function() editor.layer=LAYER_BACKGROUND end,
|
function() editor.layer=LAYER_BACKGROUND menu.close() end,
|
||||||
function() editor.layer=LAYER_ITEMS end,
|
function() editor.layer=LAYER_ITEMS menu.close() end,
|
||||||
function() rooms.toggle_visibility(LAYER_FOREGROUND) end,
|
function() rooms.toggle_visibility(LAYER_FOREGROUND) end,
|
||||||
function() rooms.toggle_visibility(LAYER_BACKGROUND) end,
|
function() rooms.toggle_visibility(LAYER_BACKGROUND) end,
|
||||||
function() rooms.toggle_visibility(LAYER_SHADOWS) end,
|
function() rooms.toggle_visibility(LAYER_SHADOWS) end,
|
||||||
@@ -82,6 +82,13 @@ menu = {
|
|||||||
end
|
end
|
||||||
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,
|
-- current_x = 0,
|
||||||
--
|
--
|
||||||
-- init = function()
|
-- 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 |
@@ -20,7 +20,7 @@ score = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
inc = function(value)
|
inc = function(value)
|
||||||
print("score.inc()")
|
--print("score.inc()")
|
||||||
score.points = score.points + value
|
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)
|
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
|
end
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ sprites = {
|
|||||||
init = function()
|
init = function()
|
||||||
sprites.hero = {
|
sprites.hero = {
|
||||||
type = "hero",
|
type = "hero",
|
||||||
pos = { x=28, y=4*13*8+71 },
|
pos = { x=28, y=4*13*8+79 },
|
||||||
size= { w=16, h=17 },
|
size= { w=16, h=17 },
|
||||||
bbo = { left=3, top=2, right=3, bottom=0 },
|
bbo = { left=3, top=2, right=3, bottom=0 },
|
||||||
current_frame = 1,
|
current_frame = 1,
|
||||||
@@ -196,6 +196,7 @@ sprites = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
update_mummy = function(spr)
|
update_mummy = function(spr)
|
||||||
|
map.surf(rooms.surf_foreground)
|
||||||
if spr.state == templates.ALIVE then
|
if spr.state == templates.ALIVE then
|
||||||
if sprites.hero.state == templates.ALIVE then
|
if sprites.hero.state == templates.ALIVE then
|
||||||
local x1,y1,w1,h1 = util.aabb(spr) -- El meu aabb
|
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_me1 = map.tile(tx1,ty+2)
|
||||||
local tile_under_me2 = map.tile(tx2,ty+2)
|
local tile_under_me2 = map.tile(tx2,ty+2)
|
||||||
if tile_under_me1 == 0 and tile_under_me2 == 0 then
|
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)
|
game.change_room(0,1)
|
||||||
else
|
else
|
||||||
if sprites.hero.cooldown % 4 == 0 then
|
if sprites.hero.cooldown % 4 == 0 then
|
||||||
@@ -471,7 +472,7 @@ sprites = {
|
|||||||
anim = move_anim
|
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
|
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 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)
|
game.change_room(0,1)
|
||||||
else
|
else
|
||||||
sprites.hero.pos.y = sprites.hero.pos.y + 1
|
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_me1 = map.tile(tx1,ty+2)
|
||||||
local tile_under_me2 = map.tile(tx2,ty+2)
|
local tile_under_me2 = map.tile(tx2,ty+2)
|
||||||
if tile_under_me1 == 0 and tile_under_me2 == 0 then
|
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)
|
game.change_room(0,1)
|
||||||
else
|
else
|
||||||
if sprites.hero.pos.y >= 808 then
|
if sprites.hero.pos.y >= 808 then
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ templates = {
|
|||||||
surf = surf.load("misc.gif"),
|
surf = surf.load("misc.gif"),
|
||||||
animation = "coin",
|
animation = "coin",
|
||||||
state = templates.ALIVE,
|
state = templates.ALIVE,
|
||||||
|
timer = 0,
|
||||||
light = 15,
|
light = 15,
|
||||||
light_ox = 4,
|
light_ox = 4,
|
||||||
light_oy = 4,
|
light_oy = 4,
|
||||||
|
|||||||
Reference in New Issue
Block a user