Skip to content
Carenalga edited this page Nov 27, 2022 · 5 revisions

Description

Each region you create will have its own script file (based on RegionTemplate.gd). This is created with the name you give the region in the Create region popup prefixed by Region: E.g. RegionMysteriousCorner.gd, RegionMetalFloor.gd.

Methods

  • on_character_entered( chr: PopochiuCharacter ) void

Called when a chr (PopochiuCharacter) enters the region. E.g. You can use it to change the footsepts sound effect.

By default this applies a color (white) to the character. The color is defined in the tint property of the region (editable in the Inspector).

func on_character_entered(chr: PopochiuCharacter) -> void:
  if C.player == chr:
    # The footsteps_sfx property is not part of the default PopochiuCharacter.
    C.player.footsteps_sfx = 'sfx_fs_metal'
  • on_character_exited( chr: PopochiuCharacter ) void

Called when a chr (PopochiuCharacter) leaves the region. E.g. You can use it to restore the footsepts sound effect to its default value.

By default this applies a white color to the character.

func on_character_exited(chr: PopochiuCharacter) -> void:
  if C.player == chr:
    # The footsteps_sfx property is not part of the default PopochiuCharacter.
    C.player.footsteps_sfx = 'sfx_fs_default'
Clone this wiki locally