Conversation
|
Play this branch at https://endlessm.github.io/moddable-platformer/branches/endlessm/specials. (This launches the game from the start, not directly at the change(s) in this pull request.) |
|
@jgbourque this is incomplete (no shrink action yet) but please test and give feedback:
|
|
The keybindings are difficult in part because we want to support two players on a single (laptop!) keyboard, so the P1 and P2 bindings need to be constrained to the right and left (respectively) of the keyboard. This also means we can't use alphabetical mnemonics such as T for teleport; and since we have actions you need to hold down, they need to be far enough apart that you can potentially control the arrows with one hand and the actions with the other. So far we have limited ourselves to the arrow keys and WAD; with the exception of AZERTY in Francophone countries (and nerds like me who use Dvorak), WAD are in the same place on all latin-alphabet-based languages' keyboards, and to the best of my knowledge keyboards for other scripts such as cyrillic and arabic are often dual-labelled with QWERTY labels (so WAD are labelled in the correct places on those). But if we need more actions then we need to pick more keys. One option is to e.g. bind the two shifts to player 1 and player 2's teleport action (for example). But then we have to carefully show in the HUD that it is right-shift for P1 and left-shift for P2. (Another option would be to make the player controllable by BOTH inputs by default, in which case both shifts would work.) |
345c804 to
8d5af58
Compare
If the player holds down the "jump" action, their character's downwards speed is capped to a constant. This allows the player-character to travel across wider gaps by jumping then gliding. The function call for this ability is in _physics_process(), after other "normal" adjustments to the velocity but before move_and_slide(). However, it is commented out. A learner must find this commented-out line and uncomment it to enable this ability. The sound effect is from https://freesound.org/people/tothrec2/sounds/596541/, licensed under CC0-1.0.
If the player enters this action while also holding left or right, the player-character teleports by a constant distance horizontally. On keyboard, this is bound to "Enter" for player 1 (who moves with the arrow keys), and "Shift" for player 2 (who moves with WASD). On gamepad, this is bound to Xbox button B. The function call for this ability is in the correct place in _physics_process() but is commented out. A learner must find this commented-out line and uncomment it to enable this ability. The sound effect is https://freesound.org/people/D.S.G./sounds/244654/ (CC0-1.0).
This adds an action that, while held, temporarily prevents the player-character from colliding with enemies or coins. The new action is bound to: - Player 1: Backspace - Player 2: Tab - Gamepad: Xbox X / PlayStation Square As with the other new actions, the function call to implement this is commented out.
As with the other special abilities, the function call in _physics_process() that implements this ability is commented out.
|
Having discussed this with @jgbourque, I have revised this PR to only add the new abilities, without updating the HUD to show the inputs for the new actions, tweaking the world to require these abilities to reach new spaces, or adding hints in the world. I'll do those in follow-up PRs. I added more thorough comments to the code & constants, along with some strategically-placed FIXMEs with ideas for how these specials could be improved. |
|
I'm going to go ahead and merge these since Justin said before going away on PTO that these meet his requirements. |
No description provided.