Skip to content

Commit

Permalink
+ random bullet speed
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed May 14, 2009
1 parent 51e7cd1 commit 4f2bd05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/units/bullet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize window
@shape.collision_type = :bullet

self.friction = 0.1
self.velocity = 50
self.velocity = 50 + rand(30)
end

def validate_position
Expand Down
2 changes: 1 addition & 1 deletion lib/units/gun.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize window
@shape = CP::Shape::Circle.new CP::Body.new(1000.0, 75.0), 11.0, CP::Vec2.new(0, 0)
@shape.collision_type = :gun

skill = rand * 0.5
skill = rand * 0.1

self.shoots Bullet
self.muzzle_position_func { self.position + self.direction_from_earth*10 }
Expand Down

0 comments on commit 4f2bd05

Please sign in to comment.