Skip to main content

Keyboard controls

PlatformerGame uses intuitive keyboard controls for all player actions. The game is built with Unity’s Input System for responsive and precise control.

Movement

WASD keys

Use W, A, S, D keys for movement:
  • A: Move left
  • D: Move right
  • W: Jump (alternative)

Arrow keys

Use arrow keys for movement:
  • Left Arrow: Move left
  • Right Arrow: Move right
  • Up Arrow: Jump (alternative)

Actions

KeyActionDescription
SpaceJumpPrimary jump button - press and hold for higher jumps
EnterStart GameBegin playing from the Title screen
EscQuitExit the game
Both WASD and arrow keys work simultaneously - use whichever feels more comfortable for your playstyle.

Gameplay mechanics

Jumping system

The game features a sophisticated jumping system implemented in PlayerJump.cs:
  • Variable height jumping: Hold the jump button longer for higher jumps. The jump height scales based on how long you press the button (up to PressTimeToMaxJump duration)
  • Double jump: After your first jump, you can perform a second jump in mid-air for extra height and distance
  • Wall sliding: When touching a wall in the air, your fall speed is reduced to WallSlideSpeed, allowing for wall jump maneuvers

Movement controls

Player movement is handled by the PlayerInput.cs script with these characteristics:
  • Speed: Default horizontal movement speed is 5.0 units per second
  • Direction: The character sprite automatically flips to face the direction you’re moving
  • Animation: Walk animation speed adjusts based on your movement intensity

Collecting coins

Coins are collected automatically when your player touches them:
  • Walk or jump into a coin to collect it
  • Each coin adds to your total score
  • Collected coins trigger the Coin.OnCoinCollected event and are removed from the level
  • Your final score is displayed at the end of the game

Power-ups

Power-ups provide temporary ability boosts:
  • Collection: Touch a power-up item to activate its effect
  • Jump boost: Increases your jump height for enhanced platforming
  • Effect application: Power-ups use Unity ScriptableObjects, allowing for easy customization of effects
Be careful near edges and hazards! Falling off the level or touching death zones will respawn you at the start.

Tips for success

1

Master the variable jump

Practice short taps for small hops and long presses for maximum height. This is crucial for landing precisely on narrow platforms.
2

Use double jump strategically

Save your double jump for when you really need it. You only get one per grounded jump, so use it to recover from mistakes or reach high areas.
3

Utilize wall sliding

When falling near a wall, press into it to activate wall slide. This slows your descent and lets you reposition for a wall jump.
4

Collect everything

Explore thoroughly to find all coins and power-ups. They’ll help you achieve a higher score and make difficult sections easier.

Input system configuration

The game uses Unity’s Input System package with configuration files located in Assets/InputSystem/. The input handling is split across multiple components:
  • PlayerInput.cs: Handles horizontal movement via the OnMove callback
  • PlayerJump.cs: Responds to jump button press (OnJumpStarted) and release (OnJumpFinished) events
  • MainMenu.cs: Handles the Enter key for starting the game from the Title screen
  • QuitGame.cs: Handles the Esc key for exiting the application
This event-driven approach ensures responsive controls and clean separation of input handling from game logic.

Build docs developers (and LLMs) love