Posted July 27, 2024 by Oxey405
#technical #update #chapter 3 #early access
Before starting to chat about the progress I’ve made, I would like to thank those who bought the game in early access and gave it a try! I’m looking forward to their feedback and I hope everyone is having a great time with the game! (insert reminder that the price will go up as I release more and more chapters) If you want to play Weirdlab Inc the homepage is here :)
So it has been a fantastic launch week! People played the game and seem to greatly enjoy it and apparently no game-breaking bug in view (so far)! With the first two chapters 95% done (some lore might change) I started to work on the 3rd chapter.
The theme for this chapter is (spoiler alert) LASERS!
Lasers are cool and are a staple of sci-fi games since the first years of gaming (space invaders, asteroids, etc…).
My approach on Weirdlab Inc has always been to maximize a physics-like behavior since this is what most of my favorite games make heavy use of physics.
Making physics, however, is pretty hard and especially on the Playdate’s hardware even though the SDK massively helps.
Figuring out physics took some maths (and this is why you stay in school).
The first thing was to create a line (raycast) and draw it which is harder than previously thought since playdate’s sprites draw in rectangle spaces but after some ugly code I ended up using what I call an “overlay sprite” that covers the whole screen and has a custom draw function that translates the laser segments into actual segments on screen.
Making the laser stop on terrain was relatively easy ; using the querySpriteInfoAlongLine
function and iterating on the results to check if the sprite collided is supposed to be solid (using a custom variable system) and then creating a final segment that starts at where the laser is shot and ends where the raycast hits a solid object.
Then came mirrors…
Mirrors are surprisingly complex objects especially when you have to program them. After many failed attempts and with heavy debugging help from Remi (thanks remi) I boiled the logic down to roughly this ;
Did you know Lua doesn’t have a continue
keyword to skip the rest of a for loop’s logic so you have to use a dirty goto
I went in vacation right after releasing the game in early access (production on friday isn’t good I know, but I got lucky) and i’m still in vacation so don’t expect a big game update until at least end of August but I’ll update you regularly on my progress using itch.io’s devlog system.
I won’t spoil level solutions or lore don’t worry and I hope you enjoy me sharing the technical side behind making playdate games even though I keep it at a high level. I have strong hopes that someday I’ll be able to show my code at a playdate gamedev conference and say “this part was where I learned how to use Lua and this part was where I started to understand” or something along those lines.
If you have any questions be sure to mention me on Playdate Squad’s server or on the game’s server and if I’m online I’ll probably answer same day. If you want to experience my game it’s here thanks for reading and thanks again to the early players!