Class: TankSpeedPowerup

Inherits:
Powerup show all
Defined in:
lib/entities/powerups/tank_speed_powerup.rb

Instance Attribute Summary

Attributes inherited from GameObject

#components, #location, #x, #y

Instance Method Summary collapse

Methods inherited from Powerup

#box, #initialize, #on_collision, #remove, #respawn_delay

Methods inherited from GameObject

#box, #collide, #draw, #effect?, #initialize, #mark_for_removal, #move, #on_collision, #removable?, #update

Constructor Details

This class inherits a constructor from Powerup

Instance Method Details

#graphicsObject



11
12
13
# File 'lib/entities/powerups/tank_speed_powerup.rb', line 11

def graphics
  :wingman
end

#pickup(object) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/entities/powerups/tank_speed_powerup.rb', line 2

def pickup(object)
  if object.class == Tank
    if object.speed_modifier < 1.5
      object.speed_modifier += 0.10
    end
    true
  end
end