Compare commits
2 Commits
3edd8c6bf3
...
c0dfd49360
| Author | SHA1 | Date | |
|---|---|---|---|
| c0dfd49360 | |||
| ed4bcb3566 |
@@ -169,6 +169,12 @@ editor = {
|
|||||||
editor.modified = true
|
editor.modified = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if editor.item_hovered and key.press(key.DELETE) then
|
||||||
|
local sprite = sprites.list[editor.item_hovered]
|
||||||
|
map.surf(rooms.surf_items)
|
||||||
|
map.tile(sprite.pos.x//8,sprite.pos.y//8,0)
|
||||||
|
sprites.remove(sprite)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 1004 B |
@@ -159,7 +159,7 @@ sprites = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
update_bullet = function(spr)
|
update_bullet = function(spr)
|
||||||
local tx, ty = (spr.pos.x+2)>>3, (spr.pos.y+1)>>3
|
local tx, ty, ty2 = (spr.pos.x+2)>>3, (spr.pos.y+1)>>3, (spr.pos.y+2)>>3
|
||||||
|
|
||||||
if rooms.is_outside(tx,ty) then sprites.remove(spr) return end
|
if rooms.is_outside(tx,ty) then sprites.remove(spr) return end
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ sprites = {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if map.tile(tx,ty) < 16 then
|
if map.tile(tx,ty) < 16 or map.tile(tx,ty2) < 16 then
|
||||||
if spr.flipped then
|
if spr.flipped then
|
||||||
spr.pos.x = spr.pos.x - 8
|
spr.pos.x = spr.pos.x - 8
|
||||||
else
|
else
|
||||||
@@ -296,7 +296,7 @@ sprites = {
|
|||||||
elseif key.down(key.X) or pad.down(pad.B) then
|
elseif key.down(key.X) or pad.down(pad.B) then
|
||||||
sprites.hero.shooting = true
|
sprites.hero.shooting = true
|
||||||
local x = sprites.hero.flipped and sprites.hero.pos.x+8 or sprites.hero.pos.x-8
|
local x = sprites.hero.flipped and sprites.hero.pos.x+8 or sprites.hero.pos.x-8
|
||||||
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+8}, flipped=sprites.hero.flipped})
|
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped})
|
||||||
table.insert(sprites.list, bullet)
|
table.insert(sprites.list, bullet)
|
||||||
if sprites.hero.flipped then sprites.hero.pos.x=sprites.hero.pos.x-8 end
|
if sprites.hero.flipped then sprites.hero.pos.x=sprites.hero.pos.x-8 end
|
||||||
anim = "hero_shoot"
|
anim = "hero_shoot"
|
||||||
|
|||||||
BIN
data/tiles.gif
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |