Solarus quests
1.6
Quest maker's reference
|
A carried object is a map entity that the hero is lifting, carrying or throwing.
A carried object is created automatically by the engine when the hero lifts a map entity, typically a destructible object. The carried object takes the sprite and the features of the lifted entity it is created from.
The hero can then walk with his carried object and throw it. He can even go to another map: the carried object is preserved.
Two sprites for a carried object are automatically created by the engine. You can access them like for any other entity, specifying their name in entity:get_sprite([name]).
"main"
(default): Main sprite representing the carried object. Its animation set is the one of the original entity he was created from (like a destructible object). It should have animations "stopped"
, "walking"
and "destroy"
, with the same direction as the hero. These animations will be played depending on the actions of the hero on the carried object. If the carried object was created from a destructible object that can explode, then animations "stopped_explosion_soon"
and "walking_explosion_soon"
will be played instead."shadow"
: Shadow displayed under the carried object when thrown. Its animation set is "entities/shadow"
, with the animation name "big"
.Carried objects 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 carried objects.
Returns the entity that carried this object.
Returns the number of life points that an enemy loses when the hero throws this object at it.
0
means that enemies will ignore this object.Sets the number of life points that an enemy loses when the hero throws this object at it.
damage_on_enemies
(number): The number of life points to remove to an enemy hit by this object. 0
means that enemies will ignore this object.Returns the sound to be played when this object is cut or broken.
nil
means that no sound will be played.Sets the sound to be played when this object is cut or broken.
destruction_sound_id
(string): Id of the destruction sound. nil
means that no sound will be played.Events are callback methods automatically called by the engine if you define them.
Carried objects are particular map entities. Therefore, they inherit all events from the type map entity.
See Events of all entity types to know these events.
The following events are specific to carried objects.
Called when this object has finished being lifted and is now actually carried.
Called when this object starts being thrown.
Called when this object falls on the ground and starts breaking.