Class Flyon
Parent: Enemy
The Flyon jumps out of its hiding and attacks you. It then quickly returns into its typically unreachable hiding and waits a number of seconds before it tries again.
Note the flyon is one of the rare objects that makes use of its starting position coordinates. They define the actual position the flyon is returning to after a jump; the normal coordinates merely determine where it is currently.
Class Methods
new()
new() → a_flyon
Creates a new Fylon object with the default values.
Instance Methods
distance_to_end
distance_to_end() → a_float
Current distance to the end position, in pixels.
image_dir
image_dir() → a_string
Retrieve the path to the directory where the pictures for the flyon are taken from, relative to the pixmaps directory.
image_dir=
image_dir=( path ) → path
Set the directory used to retrieve the pictures for the flyon.
Parameters
- path
-
Path for the flyon image directory, relative to pixmaps directory. Note the only real alternative to the default (pixmaps/flyon/orange) is pixmaps/flyon/blue.
max_distance
max_distance() → a_float
Retrieve the maximum number of pixels the flyon may travel.
max_distance=
max_distance=( distance ) → distance
Specify the maximum distance the flyon may travel.
Parameters
- distance
-
The new maximum distance the flyon may travel, in pixels. A float.
moving_backwards?
moving_backwards? → true or false
Whether or not the flyon is moving backwards to its original position.
speed
speed() → a_float
TODO: Docs.
speed=
speed=( speed ) → speed
TODO: Docs.
wait_time
wait_time() → a_float
Returns the number of seconds to wait betwee jumping, as a float.
wait_time=
wait_time=( secs ) → secs
Specify the time to wait between jumping.
Parameters
- secs
-
Number of seconds to wait between jumping out again. A float.