Class TurtleBoss
Parent: Enemy
The Turtle Boss is a giant turtle that needs multiple hits to be defeated. It can throw fireballs while hiding in its shell.
Events
- Downgrade
-
This event is triggered each time the Turtle Boss takes damage. Not it doesn't take damage for each hit. The event handler gets passed two arguments: how often it took damage, and how often it may take damage before it dies.
Class Methods
new
new() → a_turtle_boss
Creates a new turtle boss with the default values.
Instance Methods
angry?
angry?() → true or false
Checks if the turtle boss is angry, and if so, returns true, otherwise returns false.
downgrade_count
downgrade_count() → an_integer
Returns the number of times this turtle boss has already been downgraded.
level_ends_if_killed=
level_ends_if_killed=( bool ) → bool
Set to true to have the level finish when the turtle boss dies (the default).
Parameter
- bool
-
true to end the level on death, false to do nothing.
level_ends_if_killed?
level_ends_if_killed? → true or false
Checks if the level ends when this turtle boss gets killed, and returns true if so, false otherwise.
max_downgrade_count
max_downgrade_count() → an_integer
Return the maximum number of downgrades this turtle boss needs before it dies.
max_downgrade_count=
max_downgrade_count=( count ) → count
Set the maximum number of downgrades this turtle boss needs before it dies.
Parameters
- :count
The new maximum number of downgrades.
max_hits
max_hits() → an_integer
The maximum number of hits this turtle boss needs before it is downgraded.
max_hits=
max_hits=( hits ) → hits
Specify the maximum number of hits this turtle boss needs before it gets a single (!) downgrade.
Parameters
- hits
The new number of maximum hits.
shell_moving?
shell_moving?() → true or false
Checks whether or not the turtle is in its shell and moving.
shell_standing?
shell_standing?() → true or false
Checks whether or not the turtle is in its shell and not moving.
shell_time
shell_time() → a_float
Returns the time the turtle boss stays in the shell.
shell_time=
shell_time=( val ) → val
Set the time the turtle boss stays in the shell before coming out again.
Parameters
- val
The new in-shell-stay time.
shelled?
shelled?() → true or false
Checks whether or not the turtle is in its shell, regardless of whether the shell is moving or not.
stand_up
stand_up()
If the turtle is in its shell, make it come out and walk again. If the turtle is not in its shell, does nothing.
throw_fireballs
throw_fireballs( [ amount ] )
Throw fireballs in all directions.
Parameters
- amount (6)
The number of fireballs to throw.
walking?
walking?() → true or false
Checks whether or not the turtle is walking currently.