top of page

Light the Midnight - C# Programming

I worked as the assistant programmer on Light the Midnight, though eventually needing to take over the role of lead. I had my hand a little bit in everything with the exception of the spawning of enemies and their navigation. In our initial discussion, we wanted to make this a zany, wacky, spooky, wave survival game. My duties were making the player controller, weapon system, and UI. What we did first though, was discuss the camera angle of the game. We settled on a third person, high angle camera view, which dictated how we would control the player. 

Screenshot 2025-01-16 191137.png

It had taken me a while to get this right. I tried a few different kinds of math and went through the methods I knew about rotating an object. This was a point where I needed to explore a Unity system I hadn't explored yet: collision layers and ray casts. In learning about this, I created a variable that would track the position of the mouse, based on a ray cast from it. This was difficult to create due to the positioning of the camera. Since it was at an angle, I couldn't just set the object to look at it and call it done. The math portion is stored in a method that requires a successful hit, and a ray to make impact to execute. This allowed the player to then rotate toward where the mouse raycast was pointing. 

Screenshot 2025-01-16 185650.png

Next, I created the player's primary weapon: the flashlight. The key points from our design were it was rechargeable, but slow, shorter range, and hit consistent damage. What I looked into doing for this was originally going to be a cone, but this had a problem. If the enemy was too close it looked like the weapon was making impact and doing no damage. I then swapped it to a cylinder and this resolved the issue. The flashlight has a battery that is reduced as the beam is active. The player just needs to use left click in order to turn it on and off. We had a plan however, to include and implement more weapons that all had similar traits. Which lead to me creating the Weapons class. This took all of the traits that would be used by all of the weapons and made it easier to access when we made new ones. 

© 2025 by Jake Reilly. Proudly created with Wix.com

  • Twitter
  • LinkedIn
bottom of page