Compare commits

..

No commits in common. "c225cc6edff5ee25308f36d1732e7ef65dffb871" and "89f9bd1913a3476b062a77b0dd8048cfc4108d7b" have entirely different histories.

4 changed files with 1 additions and 18 deletions

View file

@ -60,8 +60,6 @@ function love.load()
}
}
camera = Camera()
gotoRoom('Stage')
end
function love.update(dt)

View file

@ -3,14 +3,12 @@
---@class Area:Object
---@field room Room
---@field game_objects GameObject[]
---@field world table|nil
local Area = Object:extend()
---Instantiates area
function Area:new(room)
self.room = room
self.game_objects = {}
self.world = nil
end
---Updates area
@ -38,10 +36,4 @@ function Area:addGameObject(game_object_type, x, y, opts)
return game_object
end
---Initializes HC physics as a world
---@param cell_size number|nil
function Area:addPhysicsWorld(cell_size)
self.world = HC(cell_size or 100)
end
return Area

View file

@ -7,9 +7,6 @@ local Player = GameObject:extend()
function Player:new(area, x, y, opts)
Player.super.new(self, area, x, y, opts)
self.w, self.h = 12, 12
self.collider = self.area.world:circle(self.x, self.y, math.floor(self.w*0.8))
end
function Player:update(dt)
@ -18,10 +15,6 @@ end
function Player:draw()
Player.super.draw(self)
love.graphics.setColor(1, 0.4, 0.4)
self.collider:draw()
love.graphics.setColor(1, 1, 1)
love.graphics.circle('line', self.x, self.y, self.w)
end
return Player

View file

@ -3,7 +3,7 @@ local Stage = Room:extend()
function Stage:new()
Stage.super.new(self)
self.area:addPhysicsWorld()
self.area:addGameObject('Player', gw/2, gh/2)
end