Class Furball
Parent: Enemy
Being the most dangerous enemy of the game, the furball is practically everywhere. Although it seems it isn’t dangerous, this is not necessarily true...
Note that the furball boss is not represented by a separate class. To instanciate one, you’d use this class like so:
f = Furball.new f.color = :black # This makes it a boss f.x = 530 f.y = -120 f.show
The #boss? method can be used to check whether any given furball is a furball boss.
Events
- Downgrade
-
This event is triggered each time the furball gets hit. It receives two arguments: the number of hits the furball already took and the maximum number it takes before dying. This event is only issued for the furball boss.
Class Methods
new
new() → a_furball
Create a new instance with the default values.
Instance Methods
boss?
boss?() → true or false
Hurries to check whether this really is the big, black boss furball, and if so, quickly returns true (and then disappears). Otherwise returns false.
color
color() → a_symbol
Returns the furballs current color as a symbol. For possible values, see color=.
color=
color=( color ) → color
Specify the furball’s color.
Parameters
- color
-
The furball’s new color. One of :brown, :blue, or :black; Note that :black makes the furball a furball boss.
level_ends_if_killed=
level_ends_if_killed=( val ) → val
Set to true if you want the level to automatically end when this furball boss dies.
Parameters
- val
Wheter or not to end the level.
Raises
- TypeError
This is not the big, black furball boss.
level_ends_if_killed?
level_ends_if_killed? → true or false
Whether or not to finish the level if this furball boss gets killed.
max_downgrade_count
max_downgrade_count() → an_integer
Retrieves the maximum number of downgrades this furball needs to have before it dies. Only useful for the boss furball.
max_downgrade_count=
max_downgrade_count=( val ) → val
Sets the number of downgrades this boss furball needs to have before it dies.
Parameters
- val
-
Maximum number of downgrades before it dies. Cannot be negative.
Raises
- TypeError
This is not the big, black boss furball.