summaryrefslogtreecommitdiff
path: root/objects
diff options
context:
space:
mode:
Diffstat (limited to 'objects')
-rw-r--r--objects/Player.lua8
-rw-r--r--objects/Shot.lua8
2 files changed, 8 insertions, 8 deletions
diff --git a/objects/Player.lua b/objects/Player.lua
index d515a5f..9b36dd9 100644
--- a/objects/Player.lua
+++ b/objects/Player.lua
@@ -14,7 +14,7 @@ function Player.new()
y = love.graphics.getHeight() / 2,
r = config.player.size,
zoom = 1/16,
- speed = config.defaultPlayerSpeed,
+ speed = config.player.speed,
shieldedTill = 0,
hearts = { "redheart", "redheart", "redheart", "shinyheart", "shinyheart", "stickyheart" },
facing = Direction.DOWN,
@@ -91,7 +91,7 @@ function Player:shoot(target)
bullets.fire(currentBullet, target, self)
table.remove(self.hearts)
- self.shootCooldown = G.time + config.playerShootCooldown
+ self.shootCooldown = G.time + config.player.shoot.cooldown
end
function Player:punchCoolingDown()
@@ -158,7 +158,7 @@ function Player:onContact(other, contact)
self.knocked = G.time + config.player.knockback.duration
self.physicsBody:applyLinearImpulse(knockbackX, knockbackY)
-- shield this player
- self.shieldedTill = G.time + config.playerShieldTime
+ self.shieldedTill = G.time + config.player.shieldTime
end
end
end
@@ -170,7 +170,7 @@ function Player:update(dt)
-- deal with speed up time
if self.speedUpTill and self.speedUpTill < G.time then
- self.speed = config.defaultPlayerSpeed
+ self.speed = config.player.speed
self.speedUpTill = nil
end
diff --git a/objects/Shot.lua b/objects/Shot.lua
index 35c7514..48e5869 100644
--- a/objects/Shot.lua
+++ b/objects/Shot.lua
@@ -9,16 +9,16 @@ function Shot:new(bulletType, target, firer, friendly)
local length = math.sqrt(vx*vx + vy*vy)
local cos, sin = vx / length, vy / length
- local offset = (config.bulletSize + (firer.physicsShape and firer.physicsShape:getRadius() or 0)) / 2
+ local offset = (config.bullet.size + (firer.physicsShape and firer.physicsShape:getRadius() or 0)) / 2
local fireX = firer.x + cos * offset
local fireY = firer.y + sin * offset
local obj = {
type = bulletType,
x = fireX, y = fireY,
- speed = { x = cos*config.bulletSpeed, y = sin*config.bulletSpeed },
+ speed = { x = cos*config.bullet.speed, y = sin*config.bullet.speed },
orientation = math.asin(sin),
- r = config.bulletSize,
+ r = config.bullet.size,
damage = (bulletData[bulletType] and bulletData[bulletType].damage) or 100,
mass = (bulletData[bulletType] and bulletData[bulletType].mass) or 0.1,
friendly = friendly == nil and true or friendly
@@ -26,7 +26,7 @@ function Shot:new(bulletType, target, firer, friendly)
setmetatable(obj, Shot)
- G.BodyLifeCycleManager:create(obj, config.bulletSize, "dynamic")
+ G.BodyLifeCycleManager:create(obj, config.bullet.size, "dynamic")
return obj
end