Skip to content

Scene room (abstraction)

ZachNalepa edited this page Nov 13, 2023 · 1 revision

Node Structure

Scene room

Variables

  • var enemy_amount : int
    • the amount of enemies appearing in a room
    • used while spawning enemies during transition()
  • var nextRoom : string
    • string to represent the nextRoom file in the available_rooms dictionary
  • var entered : bool
  • var enemy_positions : Dictionary()
    • dictionary containing marker2D nodes and their associated id
  • var parent : node tree
    • node tree for instantiating and freeing nodes

Methods

  • _ready()
    • first method called when room is instanced
    • spawns npcs (if any)
  • _process(delta)
    • processes the pause screen
  • clear_doors()
    • clears the tilemap layer with the closed doors
  • enemy_position_getter(int)
    • given an id, returns the marker2D node associated with the id
  • player_position_getter()
    • returns the marker2D node for the player spawn
  • on_doors_body_entered(body)
    • calls the transition() function from the map system when the player enters the open doors

Clone this wiki locally