A prototype physics / puzzle game built with LÖVE.
Check out the video demo for example gameplay.
Inspired by the old gag, "How many people does it take to change a lightbulb?", Maintenance Man gives us an answer once and for all.
Using the Men At WorkTM crate that dispenses a new Maintenance Man at the touch of a button, it's up to you to hold ladders in place and throw bulbs around until you manage to get a lightbulb in the fixture, lighting up the room and winning the game.
Move
w a s d
← ↑ ↓ →
Jump
________
Hire a maintenance man
x
Hold a ladder
l
Throw a lightbulb
e
Menu
Esc
In addition to cloning the repository, you will need to download and install LÖVE if you don't have it already. Follow the specific instructions for your OS below.
- If given the option, install LÖVE to
"C:\Program Files\LOVE\love.exe" - Alternatively, make a note of the installation path, and update
run.batto replace"C:\Program Files\LOVE\love.exe"with the correct path. - Open a terminal in the project folder and execute
.\run.bat. This will run LÖVE and point it at the project folder.
- After installing LÖVE, verify that the
lovecommand is available and working in your terminal. Don't forget to start a new terminal session after installing! - Navigate to the project root directory and execute
love .
- Ensure you install LÖVE in the Applications folder.
- Add an alias to your terminal resource configuration (e.g.
~/.bashrc,~/.zshrc,~/.bash_profile) as below:
alias love="/Applications/love.app/Contents/MacOS/love"
- In a new terminal session, navigate to the project root directory and execute
love .
If you get stuck further installation instructions and help is available on the official Love2d Wiki.
main.lua is the entry point for the program. After importing the code, the first thing the runtime does is call love.load(). This is called once only. Most of the setup work is done here:
- Loading assets
- Initializing the map and the physics world
- Creating tables to hold the player character and other physics objects
- Loading the menu screen
After this, the entire programv essentially boils down to two functions, invoked repeatedly in succession:
love.update()
love.draw()
These two functions constitute the game loop. The update function is where the heavy lifting happens:
- Physics calculations, which are mostly handled by the
love.physicsAPI, a wrapper for the Box2D physics engine. - Determining what graphics should be drawn, e.g. specific animation frames, the background image, whether a bulb is on or off depending on whether the win condition is met, etc.
Then in draw the love.graphics() API is invoked to render the frame to the screen.
All "dependencies" are simply copied-and-pasted code which I've discovered from two main sources:
- Sheepolution, a great starting point for learning Lua for games, and an introduction to the Classic library which I have used widely in this project.
- DevJeeper's "Platformer Tutorial Series", particularly for its introduction to Tiled and STI
For the images and audio assets I have the following people to thank:
-
- Composed, recorded and mixed three original tracks for the menu music, in-game music, and win music
- Directed, recorded, and mixed audio for the sound effects, and performed most of them himself (a few were provided by yours truly!)
-
Lakshmi Haridas provided the cartoon for the Maintenance Man himself