Class Rokko
Parent: Enemy
Rokko is the biggest enemy in the game. When he appears, the best you can do usually is this: Run! Rokko is basically invincable and ignores all restrictions put upon other objects such as massive walls or gravity. He just bursts through everything. The only way to defeat Rokko is to somehow get upon his head, which — depending on the circumstances — can be hard to impossible. When not flying sideways, but upwards or downwards, this is entirely impossible.
Rokko may either work in self-activating or manual triggering mode, the former being the default. When self-triggering, Rokko will go off as soon as Alex enters the area Rokko observes towards the front (see #max_front_distance=) and towards the sides (see #max_sides_distance=). While for "ordinary" levels created without scripting this behaviour is just fine, but for scripting you might want to activate Rokko depending on other arbitrary conditions (such as enemy death). This is called manual triggering_ and can be activated like this:
rokko = Rokko.new rokko.direction = :right rokko.manual = true
In manual triggering mode, Rokko doesn’t observe anything and hence does not self-trigger, regardless of Alex’s position. To fire off, check your condition and call #activate!:
if some_condition rokko.activate! end
Class Methods
new
new() → a_rokko
Creates a new rokko with the default values.
Instance Methods
activate
activate()
Triggers Rokko. He will fly and downgrade Alex if he is in his way.
activate!
activate!()
Like #activate, but does not play the Rokko start sound. The player will not notice Rokko has started!
flying?
flying?() → true or false
Checks wheter Rokko has been activated, either manually or by self-triggering.
manual=
manual=( bool ) → bool
Set this to true in order to activate manual triggering. false activates self-triggering mode.
manual?
manual?() → true or false
Whether or not Rokko is in manual triggering mode.
max_front_distance
max_front_distance() → a_float
Returns the maximum number of pixels Rokko will use as the Alex detection area to the front.
max_front_distance=
max_front_distance=( val ) → val
Sets the maximum number of pixels Rokko will go off in if Alex enters that room before Rokko’s head.
Parameters
- val
-
Maximum number of pixels Rokko will use as detection area.
max_sides_distance
max_sides_distance() → a_float
Returns the maximum number of pixels Rokko will use as the Alex detection area to the sides.
max_sides_distance=
max_sides_distance=( val ) → val
Sets the maximum number of pixels Rokko will go off in if Alex enters that room next to Rokko (but not behind).
Parameters
- val
-
Maximum number of pixels Rokko will use as detection area.
speed
speed() → a_float
TODO: Docs.
speed=
speed=( val ) → val
TODO: Docs.