Interactable Objects summary - jjppof/goldensun_html5 GitHub Wiki

Interactable Objects summary

This tutorial will cover some key points of available interactable objects in the engine and how to config them.
Please read Adding Interactable Objects to the map tutorial before reading this one.

Pushable

Pushable interactable objects are the ones that can be pushed by the hero or targeted by Move psynergy.
In order to make an interactable object pushable, you need to set the property "pushable" to true in the interactable_objects_db.json file.

image

When adding a pushable interactable object to the map, you need to delimit the area where it can be pushed. You can do this by setting the "allowed_tiles" property that accepts a list of tile positions and/or a list of rectangular ranges, please check this link to see how to use this property.

image

Pushables can also be docked when reaching certain position at a given collision layer. You can set this key position on "dock_tile_position" property, please check this link to see how to use this property.

Pushables can also be dropped to a lower collision layer or even into the water. For this, you need to set the "object_drop_tiles" property. On this property, you need to specify a list of positions that when this interactable object reaches this position, it will fall on a given y destination position and collision layer. Please check this link to see how to use this property. You may want to also spread some dust when the pillar hits the ground by enabling its animation.

image

You can always fire Game Events after the hero pushes a pushable interactable object, for this, you need to set a list of events on "after_push_events" property, please check this link to see how to use this property.

Breakable

Breakable interactable objects are the ones that when the hero jumps over them, they crack. If the hero jumps another time, they completely break.
When the interactable object completely breaks, the hero will fall to its base_collision_layer collision layer.
In order to make an interactable object breakable, you need to set the property "breakable" to true in the interactable_objects_db.json file.

image

Rollable

Rollable interactable objects are the ones that will roll to a specific position when pushed by the hero. They can stop on some object hit (defined by a specific position) or they can fall on the water surface if desired.
In order to make an interactable object rollable, you need to set the property "rollable" to true in the interactable_objects_db.json file.

image

When instantiating a rollable, you need to set its direction, if it's horizontal or vertical, use "pillar_direction" property for this.

Also, you need to set the list of contact points that this rollable interactable object can hit. You just need to pass the list of positions, the engine will try to guess the best option when rolling. Use the "contact_points" property to set these positions.

image

Please notice that rollables can hit other IOs that cross the rolling line:

image

Rollables can also fall on the water surface. In order for this to happen, you just need to set the position that when reached by this IO, it will fall into the water based on rolling direction. Use "falling_pos" property to set this position.

image

If you only set "falling_pos" property, the IO will immediately fall on water surface when passing by "falling_pos" position. If you need this IO to keep falling before reaching the final position, use "dest_pos_after_fall" to set this position.

image

Please check detailed explanation for each rollable setting on this link.

Whirlwind Source

Whirlwind Source interactable objects are the ones that keep emitting whirlwinds on a regular basis. You can set the emission direction and the target destination where these whirlwinds will be dismantled. If the hero touches these whirlwinds, he will be carried by them till the target destination.
In order to make an interactable object Whirlwind Source, you need to set the property "whirlwind_source" to true in the interactable_objects_db.json file.

image

Use "dest_point" property to define the target position where the whirlwind will be dismantled.

You can control emission frequency and whirlwind moving speed by setting the "emission_interval" and "speed_factor" properties respectively.

If you want to change the map collision layer when the hero is dropped from the whirlwind that's carrying him, you can use the "drop_collision_layer" property to define it.

If you want to define a lower y destination for the hero to fall when he is dropped from the whirlwind that's carrying him, you can use the "drop_dest_y" property to define it.

Please check detailed explanation for each Whirlwind Source setting on this link.