Skip to content

Commit

Permalink
Gun moves faster
Browse files Browse the repository at this point in the history
The gun moves faster now. In fact the gun moves as fast as the aliens.
  • Loading branch information
dvberkel committed Feb 26, 2012
1 parent 54f6489 commit cb48496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/game.rb
Expand Up @@ -11,7 +11,7 @@ def start
addAlien(Alien.new({:location => Vector.new(x,y), :moveStrategy => @strategy}))
end
end
@gun = Gun.new({:moveStrategy => EventedMoveStrategy.new})
@gun = Gun.new({:moveStrategy => EventedMoveStrategy.new(Vector.new(3,0))})
addGun(@gun)
end

Expand Down
4 changes: 2 additions & 2 deletions src/movement.rb
Expand Up @@ -15,8 +15,8 @@ def notify(event)
end

class EventedMoveStrategy < MovementStrategy
def initialize
@displacement = Vector.new(1,0)
def initialize(displacement = Vector.new(1,0))
@displacement = displacement
@events = []
end

Expand Down

0 comments on commit cb48496

Please sign in to comment.