Class Thromp
Parent: Enemy
The Thromp falls down on you and squashes you. Occasionally, it doesn’t come from atop, but rather from the sides or even from the bottom. The thromp itself is immune to gravity.
Class Methods
new
new() → a_thromp
Creates a new thromp with the default values.
Instance Methods
image_dir
image_dir() → a_string
Returns the thromp’s current image directory, relative to the pixmaps/ directory.
image_dir=
image_dir=( path ) → path
Specify the image directory for the thromp.
Parameters
- path
-
The path to the thromp’s new image directory, relative to the pixmaps/ directory.
max_distance
max_distance() → a_float
Returns the current maximum distance the thromp may fall towards Alex, in pixels.
max_distance=
max_distance=( distance ) → distance
Specify the maximum distance the thromp may fall towarads Alex.
Parameters
- distance
The maximum distance in pixels. A float.
moving_backwards?
moving_backwards?() → true or false
Returns true if the thromp is moving backwards to its original position, false otherwise.
speed
speed() → a_float
Returns the thromp’s speed.
speed=
speed=( val ) → val
Specify the thromp’s new speed.
Parameters
- val
The thromp’s new speed. A float.