Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makedoor(x,y)
- local door = LuaObject(x,y)
- door:SetWidth(8)
- door:SetHeight(32)
- door.data.solid = false
- door.inside = false
- function door:OnUpdate(dt)
- local playerPosition = g_player.getRect()
- if g_collision.IsColliding(self:GetBox(),playerPosition) then
- self.inside = true
- else
- if self.inside then
- self.data.solid = true
- end
- end
- end
- return door
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement