-
Notifications
You must be signed in to change notification settings - Fork 20
Gameplay & Game Feel
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.
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.
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 thePlatfomerController
on jump.BaseJump
already implements a Mario-like jump, but you could extend this script to create your own! ABaseJump
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).
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.
Interactors
and Interactibles
allow you to trigger behaviors when an action is performed while inside an area.
-
Interactors
: These extensions ofArea2D
trigger anInteractor
when a player inputs a matching action. -
Interactibles
: These extensions ofArea2D
trigger aon_interacted
event when trriggered by anInteractor
. You can use that event to specify what should happen during that interaction. You can find an example onres://scenes/samples/platformer_sample.tscn
of aDialogInteractable
that triggers a dialog when interacted.
TODO