Oliver Nyholm
AI and Gameplay Programmer


Lua | Point and Click | Movement

About the Game

Mayday was the first game project at The Game Assembly. The project lasted for eight weeks where agile work technique was in focus. The game was created in Love2D, a Lua Engine.

"As the engineer on the ship, you have been awoken amidst an accident on the ship. Together with pepe the assistant robot, you must save the ship and crew."

My contribution

This project was my first time working with Lua and the first time I worked in a group with people from other disciplines. As I was more experienced with programming prior to my previous education, I took a lot of responsibility and worked on multiple things in the project.

One of my main contributions in the game was how we handled the different rooms. I created a file, RoomManager that had a table of all rooms. I also created the movement of both the player and the rooms transitions. I worked on some of the puzzles in the game, as well as the spritesheet system.

Here is some code of how the movement was handled in the point and click. Each room consisted of a few positions where the player could stand, and when clicked close to the area, the player would teleport there. As the game didn't need actual movement, the easiest solution would be to teleport the player, instead of moving with a movement algorithm.

The PlayerMove(aPosition) would set the target position for the player, whilest PlayerFadeImage(deltatime) would set the final position when the player was done fading out. Not too funky, Lua is just a pain to read without brackets!

The code above is how the rooms handled the movement when transitioning between then. The fading out was handled in another function. I remember trying to use a built in lerp function, but I never got the lerp to feel good. Or I was too much of a noob. Instead, I opted for some magic numbers that felt nice, slowing down abruptly at the end instead.