Skip to content

Scene player

Samman Regmi edited this page Nov 14, 2023 · 2 revisions

Scene Player

Variables

  • var MAX_SPEED : int

    • Top speed of the player
  • var ACCELERATION : int

    • Acceleration of the player on keypress.
  • var FRICTION : int

    • Friction applied on keypress released.

Methods

  • func shoot_gun() -> null:

    • Detects input to shoot gun.
    • Tells the gun scene to shoot.
  • func get_input_axis() -> Vector2:

    • Detects input for movement.
    • Returns direction of movement inputted.
  • func move(delta) -> null:

    • Moves the position of the player.
    • Changes the player animation.
  • func apply_friction(amount) -> null:

    • Applies friction.
  • func apply_movement(acceleration) -> null:

    • Applies acceleration to position.
  • func update_health() -> null:

    • Changes the health to match the healthbar.
    • Hides the healthbar when full.
  • func _on_regen_timeout() -> null:

    • Clamps player health.
    • Regenerates health over time up to 80.
  • func _on_player_hitbox_body_entered(body) -> null:

    • Checks if an npc is in range.
  • func timer_restart() -> null:

    • Starts the regen timer.
  • func _on_player_hitbox_body_exited(body) -> null:

    • Checks if an npc is in range.
  • DialogueManager.show_example_dialogue_balloon(load("res://main.dialogue"), "first") is used to call the dialogue scene, as it imports the library from the asset

Clone this wiki locally