Desolate
2023
Desolate was a game I was trying to make, kind of like ARK. You would spawn in a world, earn items and money, and either fight other players or monsters. I wrote Lua code for its inventory, camera, animations and weapons in Roblox Studio, but the game was never finished. The source code is on GitHub.
Players use the number keys to select items. I wrote a module for each tool type, with the gun module handling its camera mode, animations and input. It asks the server to equip the gun before starting those effects on the client. I kept the cleanup in that module as well, in a function it returns after equipping succeeds. When the player puts the gun away, this stops the equip and idle animations, removes the input handler and resets the camera. It also disconnects the event connection for continuous firing, if the gun has one.
For the actual projectiles I used FastCastRedux, an existing library. I wrote the code that sends the player's aim to the server and checks their equipped weapon and cooldown before firing. A hit on a character calls the damage handler. There are settings for each weapon's speed and spread, along with recoil, sound and lighting effects. I still had ammunition and attachments left to implement.
