Class: Spacewar::Planet
- Inherits:
-
Chingu::GameObject
- Object
- Chingu::GameObject
- Spacewar::Planet
- Defined in:
- lib/spacewar/spacewar.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Planet
constructor
A new instance of Planet.
Methods inherited from Chingu::GameObject
Constructor Details
#initialize(options = {}) ⇒ Planet
Returns a new instance of Planet.
166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/spacewar/spacewar.rb', line 166 def initialize( = {}) super(:zorder => 1) @image = Image["planet.png"] self.color = Gosu::Color.new(0xff000000) self.color.red = rand(255 - 40) + 40 self.color.green = rand(255 - 40) + 40 self.color.blue = rand(255 - 40) + 40 self.x = $window.width / 2 self.y = $window.height / 2 cache_bounding_circle end |