Small learning project built at the Recurse Center with LÖVE2D to explore the engine. It features a player that can jump over platforms in order to collect coins, when the player falls off the map it respawn at the initial position and the coins are reset. This game includes basic gravity and platform collision (landing on top of platforms).
Clone the repo:
git clone https://github.com/nadia-nh/rc-love2d-platformer.git
cd rc-love2d-platformer
Run with LÖVE:
- From inside the folder
love ./
- Point LÖVE at this folder
love <path-to-folder>\rc-love2d-platformer\
Controls:
- Left / right arrow keys – Move
- Up – Jump
- Esc – Quit
The main callback functions in LÖVE are :
love.load()- Runs once at the beginning, used for loading images and setting up the worldlove.update(dt)- Runs every frame, used for moving the player, applying gravity, handling collisions, respawns, and coin pickupslove.draw()- Runs every frame after update, used for drawing the background, platforms, coins, and player
The logic is organized into a few small files:
main.lua- Ties everything together, calls module functions, handles the main loopplayer.lua- Handles player movement, gravity, jumping, respawnplatforms.lua- Contains the platform list, handles collisions between the player and the platformscoins.lua- Contains coin positions, handles coin pickup logic
- Sheepolution Löve2D Tutorial - For platformer creation guide and collision logic
- Brackeys Games Platformer Bundle - For player, coin, and platform assets
