player blocker
This commit is contained in:
parent
0618cfc51d
commit
a60f46d585
12 changed files with 1141 additions and 89 deletions
21
generic_player_blocker.lua
Normal file
21
generic_player_blocker.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
require "entity"
|
||||
|
||||
-- A visual boundary that only affects player movement. It deliberately stays
|
||||
-- out of the ordinary collidable matrix, so moveable blocks can occupy and
|
||||
-- pass through the same cell.
|
||||
GenericPlayerBlocker = class("GenericPlayerBlocker", Entity)
|
||||
|
||||
function GenericPlayerBlocker:initialize(x, y, color, sprite, cellShape)
|
||||
Entity.initialize(self, {
|
||||
x = x,
|
||||
y = y,
|
||||
color = color,
|
||||
collision = "none",
|
||||
sprite = sprite,
|
||||
cellShape = cellShape
|
||||
})
|
||||
end
|
||||
|
||||
function GenericPlayerBlocker:blocksPlayer()
|
||||
return true
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue