Skip to content

Commit

Permalink
Change player fire rate and bullet speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Top-Cat committed Dec 16, 2013
1 parent 183e6c8 commit e9777c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions entity/playerbullet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require 'drawable.drawable'

PlayerBullet = class('entity.PlayerBullet', Bullet)
PlayerBullet.static.sprite = newSprite("assets/blue-bullet.png")
PlayerBullet.static.speed = Bullet.static.speed * 3

function PlayerBullet:initialize(id, x, y, collider, dir)
Bullet.initialize(self, id, x, y, self.class.sprite, collider, dir)
Expand Down
2 changes: 1 addition & 1 deletion manager/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function Game:keypressed(key, unicode)
self.movingRight = true
elseif constants.controls.shoot[key] and self.fireCooldown <= 0 then
self.eventLog:insert(PlayerBulletEvent:new(self.playerId, self.state[self.playerId].orientation), self.time)
self.fireCooldown = 5 / constants.speed
self.fireCooldown = 2 / constants.speed -- 2 is the magic number, trust in the 2
end
end
end
Expand Down

0 comments on commit e9777c1

Please sign in to comment.