Class Box
Parent MovingSprite
Box is the superclass for all boxes accessible from the scripting interface. Boxes are the little blocks that contain coins, powerups, or just spin around if jump against them.
Events
- Activate
-
The box was activated by Alex jumping against it or otherwise.
Instance Methods
activate
activate()
Activate the box, revealing what it’s inside and decrementing the usage count by one.
animation_type
animation_type() → a_symbol
Returns the box’ current animation type. See #animation_type= for a list of possible return values.
animation_type=
animation_type=( ani ) → ani
Specify the box’ appeareance.
Parameters
- ani
-
The box’ new animation type. One of the following symbols:
- bonus
The "?" box. Usually used for powerups.
- default
The blank box. Usually used for coins.
- power
The "!" box. Usually used for 1-ups.
- spin
The spinbox. This box just spins if jumped against it.
invisible
invisible() → a_symbol
Returns the box’ invisibility state. See #invisible= for possible return values.
invisible=
invisible=( invis ) → invis
Specify the box’ invisibility type.
Parameters
- invis
-
The box’ new invisibility type. One of the following symbols:
- visible
-
The box isn’t invisible.
- massive
-
The box gets visible if jumped against it. It however acts as an invisible massive block even if not activated (i.e. you can stand on it)/dd
- ghost
-
The box is only visible for Ghost Alex. Only Ghost Alex can stand on it.
- semi_massive
-
The box is visible after jumping against it from its activation direction (usually from below). While not activated, Alex can’t stand on it.
max_uses
max_uses() → an_integer
Returns the maximum number of times this box can be used.
max_uses=
max_uses=( count ) → count
Specify how many times this max be used at maximum before it stops to work.
Parameters
- count
-
The maximum number of times this box may be used. Specify a value of -1 to indicate it may be used infinitely.
remaining_uses
remaining_uses() → an_integer
Returns the remaining number of times this box may be used. Returns -1 for boxes that may be used infinitely.