Skip to content

nadia-nh/rc-love2d-platformer

Repository files navigation

RC LÖVE2D Platformer

screenshot

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).

Running the game

Clone the repo:

git clone https://github.com/nadia-nh/rc-love2d-platformer.git
cd rc-love2d-platformer

Run with LÖVE:

  1. From inside the folder
  love ./
  1. Point LÖVE at this folder
  love <path-to-folder>\rc-love2d-platformer\

Controls:

  • Left / right arrow keys – Move
  • Up – Jump
  • Esc – Quit

How the game works

The main callback functions in LÖVE are :

  • love.load()- Runs once at the beginning, used for loading images and setting up the world
  • love.update(dt) - Runs every frame, used for moving the player, applying gravity, handling collisions, respawns, and coin pickups
  • love.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 loop
  • player.lua - Handles player movement, gravity, jumping, respawn
  • platforms.lua - Contains the platform list, handles collisions between the player and the platforms
  • coins.lua - Contains coin positions, handles coin pickup logic

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages