Skip to content

Gameplay & Game Feel

Guilherme Sousa edited this page Oct 14, 2023 · 3 revisions

Gameplay & Game Feel

Movement

There are a couple of movement scripts included in this repo, and all of them extend CharacterBody2D. These nodes should therefore be the top-most node of you player scene. Lets start with the simplest of the two.

Top-Down

TopDownController is meant to be used for top-down 2D game, it is a simple CharacterBody2D that isn't affected by gravity (floating) using directional input to move.

Platformer/Sidescroller

The PlatformerController allows you to setup a simple mario-like controller. Its properties work as follows:

  • coyote_time: Time after leaving the ground (without jumping) during which the player is still allowed to jump.
  • jump_buffer_time: Time during which a jump input will be buffered. If the player hits the ground while a jump input is buffered the player will automatically jump.
  • jump: Resource that describes the behavior of a jump. It is triggered by the PlatfomerController on jump. BaseJump already implements a Mario-like jump, but you could extend this script to create your own! A BaseJump has two methods that need to be implemented in order to work, _start_jump (called when the player presses the jump button while a jump is possible) and _end_jump (called when the player releases the jump button).

Grid

GridController moves between the tiles of a TileMap, and requires a RayCast2D child node to detect collisions (don't forget to set its collision mask). It can also be used to push GridPushObject around.

Interactions

Interactors and Interactibles allow you to trigger behaviors when an action is performed while inside an area.

  • Interactors: These extensions of Area2D trigger an Interactor when a player inputs a matching action.
  • Interactibles: These extensions of Area2D trigger a on_interacted event when trriggered by an Interactor. You can use that event to specify what should happen during that interaction. You can find an example on res://scenes/samples/platformer_sample.tscn of a DialogInteractable that triggers a dialog when interacted.

Hit/Hurt boxes

TODO

Effects