- [NEW] ralentitzades les animacions
- [NEW] Desde l'editor, amb 'P' es posiciona al heroi en la posició del cursor - [ONGOING] habitacions: 6% - [NEW] Més tiles - [CHG] Reajustada velocitat de l'heroi - [FIX] Ajustada la caixa de colisió un pixelet - [CHG] Ajustat el bot màxim
This commit is contained in:
@@ -3,34 +3,34 @@ animations = {
|
|||||||
["hero_stand"] = {
|
["hero_stand"] = {
|
||||||
cycle = {1},
|
cycle = {1},
|
||||||
frames = {
|
frames = {
|
||||||
{ frame={x=0,y=0,w=16,h=17}, wait=2 },
|
{ frame={x=0,y=0,w=16,h=17}, wait=4 },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
["hero_jump"] = {
|
["hero_jump"] = {
|
||||||
cycle = {1},
|
cycle = {1},
|
||||||
frames = {
|
frames = {
|
||||||
{ frame={x=32,y=0,w=16,h=17}, wait=2 },
|
{ frame={x=32,y=0,w=16,h=17}, wait=4 },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
["hero_walk"] = {
|
["hero_walk"] = {
|
||||||
cycle = {1,2,1,3},
|
cycle = {1,2,1,3},
|
||||||
frames = {
|
frames = {
|
||||||
{ frame={x=0,y=0,w=16,h=17}, wait=2 },
|
{ frame={x=0,y=0,w=16,h=17}, wait=4 },
|
||||||
{ frame={x=16,y=0,w=16,h=17}, wait=2 },
|
{ frame={x=16,y=0,w=16,h=17}, wait=4 },
|
||||||
{ frame={x=32,y=0,w=16,h=17}, wait=2 }
|
{ frame={x=32,y=0,w=16,h=17}, wait=4 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
["hero_stairs_idle"] = {
|
["hero_stairs_idle"] = {
|
||||||
cycle = {1},
|
cycle = {1},
|
||||||
frames = {
|
frames = {
|
||||||
{ frame={x=48,y=0,w=16,h=17}, wait=2 }
|
{ frame={x=48,y=0,w=16,h=17}, wait=4 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
["hero_stairs"] = {
|
["hero_stairs"] = {
|
||||||
cycle = {1,2},
|
cycle = {1,2},
|
||||||
frames = {
|
frames = {
|
||||||
{ frame={x=48,y=0,w=16,h=17}, wait=2 },
|
{ frame={x=48,y=0,w=16,h=17}, wait=4 },
|
||||||
{ frame={x=48,y=0,w=16,h=17}, wait=2, reversed=true }
|
{ frame={x=48,y=0,w=16,h=17}, wait=4, reversed=true }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -86,8 +86,9 @@ editor = {
|
|||||||
rooms.pos.y = rooms.pos.y - 12
|
rooms.pos.y = rooms.pos.y - 12
|
||||||
elseif key.press(key.TAB) or key.press(key.ESCAPE) then
|
elseif key.press(key.TAB) or key.press(key.ESCAPE) then
|
||||||
editor.picker.show()
|
editor.picker.show()
|
||||||
elseif key.press(key.Q) then
|
elseif key.press(key.P) then
|
||||||
msgbox.show("IE MEN!", {"Hi ha canvis sense guardar.", "Vols guardar-los abans d'eixir?"}, { {"Cancel", app.pop}, {"No", function() sys.quit() end}, {"Yes", sys.quit} } )
|
sprites.hero.pos.x = tx*8-4
|
||||||
|
sprites.hero.pos.y = ty*8-9
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ rooms = {
|
|||||||
surf_items = nil,
|
surf_items = nil,
|
||||||
surf_original_items = nil,
|
surf_original_items = nil,
|
||||||
visibility = LAYER_ALL,
|
visibility = LAYER_ALL,
|
||||||
pos = {x=0, y=0},
|
pos = {x=0, y=4*12},
|
||||||
|
|
||||||
init = function()
|
init = function()
|
||||||
rooms.pos.x, rooms.pos.y = 0,0
|
rooms.pos.x, rooms.pos.y = 0,4*12
|
||||||
if rooms.surf_background ~= nil then surf.free(rooms.surf_background) end
|
if rooms.surf_background ~= nil then surf.free(rooms.surf_background) end
|
||||||
rooms.surf_background = surf.load("rooms_background.bin")
|
rooms.surf_background = surf.load("rooms_background.bin")
|
||||||
--rooms.surf_background = surf.new(20*8,12*8)
|
--rooms.surf_background = surf.new(20*8,12*8)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 378 B |
Binary file not shown.
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 605 B |
@@ -6,7 +6,7 @@ sprites = {
|
|||||||
|
|
||||||
init = function()
|
init = function()
|
||||||
sprites.hero = {
|
sprites.hero = {
|
||||||
pos = { x=24, y=15 },
|
pos = { x=28, y=4*12*8+71 },
|
||||||
size= { w=16, h=17 },
|
size= { w=16, h=17 },
|
||||||
bbo = { left=0, top=0, right=0, bottom=0 },
|
bbo = { left=0, top=0, right=0, bottom=0 },
|
||||||
flipped = false,
|
flipped = false,
|
||||||
@@ -54,6 +54,8 @@ sprites = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
update_hero = function()
|
update_hero = function()
|
||||||
|
if not sys.beat() then return end
|
||||||
|
|
||||||
-- Update hero
|
-- Update hero
|
||||||
local anim = "hero_stand"
|
local anim = "hero_stand"
|
||||||
local move_anim = "hero_walk"
|
local move_anim = "hero_walk"
|
||||||
@@ -61,15 +63,18 @@ sprites = {
|
|||||||
-- SI ESTÀ BOTANT...
|
-- SI ESTÀ BOTANT...
|
||||||
if sprites.hero.jumping > 0 then
|
if sprites.hero.jumping > 0 then
|
||||||
anim = "hero_jump"
|
anim = "hero_jump"
|
||||||
|
move_anim = "hero_jump"
|
||||||
local tx1, tx2, ty = (sprites.hero.pos.x+4)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y)>>3
|
local tx1, tx2, ty = (sprites.hero.pos.x+4)>>3, (sprites.hero.pos.x+11)>>3, (sprites.hero.pos.y)>>3
|
||||||
|
--draw.rect(tx1<<3,ty<<3,8,8,8)
|
||||||
|
--draw.rect(tx2<<3,ty<<3,8,8,28)
|
||||||
if map.tile(tx1,ty) == 0 and map.tile(tx2,ty) == 0 then
|
if map.tile(tx1,ty) == 0 and map.tile(tx2,ty) == 0 then
|
||||||
if ty<rooms.pos.y then
|
if ty<rooms.pos.y then
|
||||||
game.change_room(0,-1)
|
game.change_room(0,-1)
|
||||||
else
|
else
|
||||||
sprites.hero.pos.y = sprites.hero.pos.y - 2
|
if sprites.hero.jumping > 1 then sprites.hero.pos.y = sprites.hero.pos.y - 1 end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sprites.hero.jumping = sprites.hero.jumping - 2
|
sprites.hero.jumping = sprites.hero.jumping - 1
|
||||||
else
|
else
|
||||||
-- SI NO ESTÀ BOTANT...
|
-- SI NO ESTÀ BOTANT...
|
||||||
-- SI ESTÀ EN UNES ESCALERES...
|
-- SI ESTÀ EN UNES ESCALERES...
|
||||||
@@ -129,7 +134,7 @@ sprites = {
|
|||||||
end
|
end
|
||||||
-- SI POLSA SPACE...
|
-- SI POLSA SPACE...
|
||||||
if key.down(key.SPACE) then
|
if key.down(key.SPACE) then
|
||||||
sprites.hero.jumping = 16
|
sprites.hero.jumping = 17
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -149,7 +154,7 @@ sprites = {
|
|||||||
elseif key.down(key.RIGHT) then
|
elseif key.down(key.RIGHT) then
|
||||||
sprites.hero.flipped = false
|
sprites.hero.flipped = false
|
||||||
anim = move_anim
|
anim = move_anim
|
||||||
local tx, ty = (sprites.hero.pos.x+13)>>3, (sprites.hero.pos.y+16)>>3
|
local tx, ty = (sprites.hero.pos.x+12)>>3, (sprites.hero.pos.y+16)>>3
|
||||||
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then
|
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then
|
||||||
if tx>rooms.pos.x+19 then
|
if tx>rooms.pos.x+19 then
|
||||||
game.change_room(1,0)
|
game.change_room(1,0)
|
||||||
|
|||||||
BIN
data/tiles.gif
BIN
data/tiles.gif
Binary file not shown.
|
Before Width: | Height: | Size: 960 B After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user