- [NEW] El mono
- [NEW] Noves animacions de detallets - [NEW] Més particles i eye candy - [FIX] Si es ficava un item/enemic en la fila de baix del tot no es guardaba - [FIX] Quan se disaparaba cap a la dreta amb el final de la pantalla o una pared en la esquena, la bala no eixia - [WIP] Treballant en el marcador
This commit is contained in:
1 parent
1f6fd47b6d
commit
d2ebbccbf6
20 files changed
+172
-27
No files matched your search
@@ -92,6 +92,10 @@ function ia.update_hero()
|
||||
end
|
||||
end
|
||||
|
||||
local on_the_floor = false
|
||||
local was_falling = sprites.hero.falling
|
||||
sprites.hero.falling = false
|
||||
|
||||
-- SI ESTÀ BOTANT...
|
||||
if sprites.hero.jumping > 0 then
|
||||
anim = "hero_jump"
|
||||
@@ -156,9 +160,11 @@ function ia.update_hero()
|
||||
return
|
||||
end
|
||||
sprites.hero.pos.y = sprites.hero.pos.y + 2
|
||||
sprites.hero.falling = true
|
||||
end
|
||||
else
|
||||
-- SI NO ESTÀ CAIGUENT...
|
||||
on_the_floor = true
|
||||
if tile_under_me1==84 then
|
||||
map.tile(tx1,ty+2,68)
|
||||
local broken_tile = templates.create("brick", {pos={x=sprites.tile_to_pixel(tx1), y=sprites.tile_to_pixel(ty+2)}, flipped=sprites.hero.flipped})
|
||||
@@ -169,7 +175,7 @@ function ia.update_hero()
|
||||
local broken_tile = templates.create("brick", {pos={x=sprites.tile_to_pixel(tx2), y=sprites.tile_to_pixel(ty+2)}, flipped=sprites.hero.flipped})
|
||||
table.insert(sprites.list, broken_tile)
|
||||
end
|
||||
if tile_under_me1>=16 or tile_under_me1>=16 then
|
||||
if tile_under_me1>=16 or tile_under_me2>=16 then
|
||||
sprites.hero.pos.y = sprites.tile_to_pixel(ty)-1
|
||||
end
|
||||
anim = "hero_stand"
|
||||
@@ -188,16 +194,19 @@ function ia.update_hero()
|
||||
-- SI POLSA BOTAR...
|
||||
if ( key.down(key.X) or pad.down(pad.A) ) and sprites.hero.jump_throttle == 0 then
|
||||
sprites.hero.jumping = 17
|
||||
table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+6, y=sprites.hero.pos.y+16}, dir={x=-0.7,y=-0.3}, flipped=sprites.hero.flipped}))
|
||||
table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+8, y=sprites.hero.pos.y+15}, dir={x=-0.5,y=-0.1}, flipped=sprites.hero.flipped}))
|
||||
table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+10, y=sprites.hero.pos.y+16}, dir={x=0.7,y=-0.3}, flipped=sprites.hero.flipped}))
|
||||
table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+12, y=sprites.hero.pos.y+15}, dir={x=0.5,y=-0.1}, flipped=sprites.hero.flipped}))
|
||||
sprites.dust(sprites.hero)
|
||||
---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+6, y=sprites.hero.pos.y+16}, dir={x=-0.9,y=-0.5}, flipped=sprites.hero.flipped}))
|
||||
---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+8, y=sprites.hero.pos.y+17}, dir={x=-0.5,y=-0.7}, flipped=sprites.hero.flipped}))
|
||||
---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+10, y=sprites.hero.pos.y+16}, dir={x=0.9,y=-0.5}, flipped=sprites.hero.flipped}))
|
||||
---table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+12, y=sprites.hero.pos.y+17}, dir={x=0.5,y=-0.7}, flipped=sprites.hero.flipped}))
|
||||
|
||||
-- SI POLSA DISPAR...
|
||||
elseif (sprites.hero.gun_cooldown==0) and (key.down(key.Z) or pad.down(pad.B)) then
|
||||
sprites.hero.shooting = true
|
||||
sprites.hero.gun_cooldown = 20
|
||||
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped})
|
||||
local start_x = sprites.hero.pos.x
|
||||
if not sprites.hero.flipped then start_x = start_x + 16 end
|
||||
local bullet = templates.create("bullet", {pos={x=start_x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped})
|
||||
table.insert(sprites.list, bullet)
|
||||
anim = "hero_shoot"
|
||||
end
|
||||
@@ -206,9 +215,15 @@ function ia.update_hero()
|
||||
end
|
||||
-- ESTIGA COM ESTIGA, SI POLSA ESQUERRA O DRETA...
|
||||
if not sprites.hero.shooting and not sprites.hero.has_been_hit then
|
||||
local was_flipped = sprites.hero.flipped
|
||||
local was_standing = sprites.hero.animation == "hero_stand"
|
||||
if key.down(key.LEFT) or pad.down(pad.LEFT) then
|
||||
sprites.hero.flipped = true
|
||||
if on_the_floor and (was_standing or not was_flipped) then sprites.dust(sprites.hero) end
|
||||
anim = move_anim
|
||||
--if on_the_floor and sprites.hero.current_wait == 1 and (sprites.hero.current_frame == 1 or sprites.hero.current_frame == 3) then
|
||||
-- table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+10, y=sprites.hero.pos.y+16}, dir={x=0.1,y=-0.7}, flipped=sprites.hero.flipped}))
|
||||
--end
|
||||
local tx, ty = sprites.get_tile(sprites.hero.pos.x+3), sprites.get_tile(sprites.hero.pos.y+16)
|
||||
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then
|
||||
if tx<rooms.pos.x then
|
||||
@@ -219,7 +234,11 @@ function ia.update_hero()
|
||||
end
|
||||
elseif key.down(key.RIGHT) or pad.down(pad.RIGHT) then
|
||||
sprites.hero.flipped = false
|
||||
if on_the_floor and (was_standing or was_flipped) then sprites.dust(sprites.hero) end
|
||||
anim = move_anim
|
||||
--if on_the_floor and sprites.hero.current_wait == 1 and (sprites.hero.current_frame == 1 or sprites.hero.current_frame == 3) then
|
||||
-- table.insert(sprites.list, templates.create("polseta", {pos={x=sprites.hero.pos.x+4, y=sprites.hero.pos.y+16}, dir={x=-0.1,y=-0.7}, flipped=sprites.hero.flipped}))
|
||||
--end
|
||||
local tx, ty = sprites.get_tile(sprites.hero.pos.x+12), sprites.get_tile(sprites.hero.pos.y+16)
|
||||
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 then
|
||||
if tx>rooms.pos.x+19 then
|
||||
@@ -230,6 +249,14 @@ function ia.update_hero()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (was_falling and not sprites.hero.falling) then
|
||||
sprites.hero.flipped = not sprites.hero.flipped
|
||||
sprites.dust(sprites.hero)
|
||||
sprites.hero.flipped = not sprites.hero.flipped
|
||||
sprites.dust(sprites.hero)
|
||||
end
|
||||
|
||||
sprites.set_animation(sprites.hero, anim)
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user