Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ starting out on a completely new game :)
- Loading branch information
Showing
10 changed files
with
56 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module HorizonOriented | ||
|
||
def horizontal | ||
CP::Vec2.new(1,0) | ||
end | ||
def vertical | ||
CP::Vec2.new(0,1) | ||
end | ||
|
||
def left factor = 0.15 | ||
self.speed -= horizontal * factor | ||
end | ||
def right factor = 0.15 | ||
self.speed += horizontal * factor | ||
end | ||
def up factor = 0.15 | ||
self.speed -= vertical * factor | ||
end | ||
def down factor = 0.15 | ||
self.speed += vertical * factor | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class FirstMate < Player | ||
|
||
include HorizonOriented | ||
|
||
def initialize window | ||
super window | ||
|
||
@image = Gosu::Image.new window, "media/first_mate.png", false | ||
@shape = CP::Shape::Circle.new CP::Body.new(0.1, 0.1), 5.0, CP::Vec2.new(0, 0) | ||
|
||
self.shoots Bullet | ||
self.muzzle_position_func { self.position + horizontal * 20 } | ||
self.muzzle_velocity_func { |target| horizontal } | ||
self.muzzle_rotation_func { self.rotation } | ||
self.frequency = 20 | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters