Taken and extended from the moving platform tutorial project
Known issue: can't change the value of the exported mode variable if it's set to
use the Mode enum as an editor hint. Seems to be an engine-side bug in 3.1 stable
Squashed commit of the following:
commit 24ad88f4fa00eaac08acdfef93a0b35ad2b1fc0f
Merge: a67f0d8209e41c
Author: Răzvan C. Rădulescu <razcore.art@gmail.com>
Date: Sun May 19 23:01:37 2019 +0900
Merge branch 'redesign' of git://github.com/razcore-art/godot-metroidvania-2d into razcore-art-redesign
commit 209e41cff8
Author: Răzvan C. Rădulescu <razcore.art@gmail.com>
Date: Sun May 19 14:07:15 2019 +0300
Fix Game scene & project file
commit bfb6f449fa
Merge: a0da29dae54ee9
Author: Răzvan C. Rădulescu <razcore.art@gmail.com>
Date: Sun May 19 13:45:24 2019 +0300
Merge branch 'master' of https://github.com/GDquest/godot-metroidvania-2d into redesign
commit a0da29d799
Author: Răzvan C. Rădulescu <razcore.art@gmail.com>
Date: Sun May 19 13:36:29 2019 +0300
Reorganize 1.hook-movement folder structure and code
See InputContinuous, stores a hook input and generates input events for a few
frames, so the player can hook on a target even if they miss it by a small margin
I experimented a bit with the code before realizing for this mechanic to work,
we need to change the controls and character behavior completely, so I dropped
the code from this commit
LedgeDetector now takes the initial offset of the rays in account.
Moved the rays to not be on the edges of the characters' collider: this would
trigger a bug that's hard to reproduce, where the character would jump back to
the origin of the world.
To get the player's look direction, the code now uses sign(_velocity.x)
The ledge state is still instant.