class Bomb
Constants
- AOE
- COOLDOWN_DELAY
- DAMAGE
- INITIAL_DELAY
- MAX_CURSOR_FOLLOW
- MAX_SPEED
- SPEED_INCREASE_FACTOR
- STARTING_SPEED
Public Instance Methods
draw()
click to toggle source
# File line-em-up/models/bomb.rb, line 19 def draw # @image.draw(@x, @y, ZOrder::Projectile, scale_x = 1, scale_y = 1, color = 0xff_ffffff, mode = :default) # @image.draw(@x, @y, ZOrder::Projectile, scale_x = 1, scale_y = 1, color = 0xff_ffffff, mode = :default) # draw_rot(x, y, z, angle, center_x = 0.5, center_y = 0.5, scale_x = 1, scale_y = 1, color = 0xff_ffffff, mode = :default) ⇒ void # @image.draw_rot(@x, @y, ZOrder::Projectile, @y, 0.5, 0.5, scale, scale) return draw_rot() end
get_image()
click to toggle source
# File line-em-up/models/bomb.rb, line 15 def get_image Gosu::Image.new("#{MEDIA_DIRECTORY}/bomb.png") end
update(mouse_x = nil, mouse_y = nil, player = nil, scroll_factor = 1)
click to toggle source
Calls superclass method
Projectile#update
# File line-em-up/models/bomb.rb, line 28 def update mouse_x = nil, mouse_y = nil, player = nil, scroll_factor = 1 vx = (self.class.get_starting_speed * @scale) * Math.cos(@angle * Math::PI / 180) vy = (self.class.get_starting_speed * @scale) * Math.sin(@angle * Math::PI / 180) # Because our y is inverted vy = vy * -1 @x = @x + vx @y = @y + vy super(mouse_x, mouse_y) end