Solarus quests
1.6
Quest maker's reference
|
When walking on a stream, the hero automatically moves into one of the eight main directions.
This type of map entity can be declared in the map data file. It can also be created dynamically with map:create_stream().
A stream is a map entity of size 16x16 pixels (the size of the hero). When the hero overlaps a significant part of it, he moves into a specific direction (one of the 8 main directions).
During this process, the player may or may not continue to control the hero, use his sword and his equipment items, depending on the stream properties.
The hero is not the only map entity that can follow a stream: Bombs also have this ability.
If you make a stream that moves toward a hole or other bad ground, it is your responsibility to make sure to call hero:save_solid_ground() before (typically, when entering the room), otherwise the hero will reappear on the stream, one pixel before the hole and he will fall again repeatedly.
Streams are particular map entities. Therefore, they inherit all methods from the type map entity.
See Methods of all entity types to know these methods.
The following methods are specific to streams.
Returns the direction of this stream.
This direction will be applied to entities that follow the stream.
0
(East) and 7
(South-East).Sets the direction of this stream.
This direction will be applied to entities that follow the stream.
direction
(number): The direction to set, between 0
(East) and 7
(South-East).Returns the speed applied by this stream.
Sets the speed applied by this stream.
speed
(number): The speed to set in pixels per second. The default value is 40
.Returns whether the player can still move the hero while being on this stream.
true
if the player can still move, false
if this is a blocking stream.Sets whether the player can still move the hero while being on this stream.
allow_movement
(boolean): true
to allow the player to move, false
to make a blocking stream. No value means true
.Returns whether the player can still use the sword while being on this stream.
true
if the player use his sword.Sets whether the player can still use the sword while being on this stream.
allow_attack
(boolean): true
to allow the player to use the sword. No value means true
.Returns whether the player can still use equipment items while being on this stream.
true
if the player can still use equipment itens.Sets whether the player can still use equipment items while being on this stream.
allow_item
(boolean): true
to allow the player to use equipment items. No value means true
.Events are callback methods automatically called by the engine if you define them.
Streams are particular map entities. Therefore, they inherit all events from the type map entity.
See Events of all entity types to know these events.
None.