74 days to become a Game Developer. Day 10.

Yes, those are pumpkins floating through space.
  • First challenge: “Limit the lasers fired by the player to only15 shots. When the player is out of ammo, provide feedback through on-screen elements or sound effects. (ie: beep or ammo count displayed on screen)”. I decided that for this challenge I wanted to add a text component to the UI and have it flicker when the player’s ammo hits 0. When the ammo is equal to 0, I wanted to disable the laser as well. To achieve this, the first thing I did was create a text component in the UI. I hardcoded in the string so I could figure out the layout (actually if you look closely at the GIF above you can see how I still need to take it out) . After that I opened the UIManager script to create a variable for the text. In the UIManager I also needed to create a method that passed in a parameter of type int so that once I created an int to keep track of the player ammo in the Player script, I would have a way to convert it to a string for the UI display. This method also takes care of the the flicker feature which was created using a Coroutine.
  • In the Player script I created an int to hold the player’s ammo and added into the LaserBehavior() a decrement by one to the ammo every time the laser is shot, an if statement to set ammo back to 0 if it falls below 0, the UpdateAmmo() from the UIManager script to pass in the ammo int, and an if statement to only fire the laser if the ammo is not equal to 0.
  • Pumpkins! Not sure what I’m going to do with these pumpkins yet but in honor of my favorite holiday coming up this Saturday I want to try to work it in somehow…. we shall see.
  • Added a new enemy that I’m still working on. That’s the cool guy in green. Will provide an update on that tomorrow. Got some weird behavior going on with the animation that I’m trying to figure out.
  • Added Thruster feature. Challenge: “Move the player at an increased rate when the ‘Left Shift’ key is pressed down. Reset back to normal speed when the ‘LeftShift’ key is release”.
Big Thanks to Ryan(fellow intern) for the GetKey tip!
  • Never recovered my files from yesterday due to Git issue mentioned in my post from Day 9! Good learning lesson though.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Concatenation (+) and Repetition (*) in Python

Google Flutter And Dart

What is Rails Today?

Create a QR-Code Decoder web application using OpenCV and Streamlit

Ruby Creator Yukihiro Matsumoto: Ruby is designed for humans, not machines

Top 10 Java Books for Programmers — All time Great

best Java books of all time

Error: Get “http://localhost/api/v1/namespaces/xxx": dial tcp [::1]:80: connect: connection refused

Scrape Google Inline Images with Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mar McRae

Mar McRae

More from Medium

Coding Africa an initiative by CUDOS partner KamPay.

My Introduction

What is Git?

Single Page Web app using the DOM and JavaScript