Exam Prep – Individual Game (Pt.2)

Carrying on from last week, we were back to our solo games. Ant revisited the waypoint code for the guards for us to implement. Having covered this twice before I had my one lone scientist setup to patrol back and forth (to what would eventually be the locations of two computers) in a jiffy. I didn’t need to use an the more advanced waypoints script with the array for this simple first room however I’ll revisit that later in another level. I won’t post the whole guard script again as we have plenty of older posts covering this.

20170314_161326
Post it notes breaking down the class tasks into manageable chunks.

Originally the scientist sprite didn’t rotate, I had managed to code this into the player character using some code found online. I asked for some assistance from Ant to reverse enginner this to work for the scientist and it now works a treat.

rotateguard

scientistmove

We also needed a fail/game over condition added this week. The best place to start with this would be collision with the now mobile scientist/guard. Nobody is firing projectiles yet, or seeking the player so it seemed like the only reasonable fail condition for the first level. Using tags to identify the scientists an OnCollision2DEnter was setup within the player movement code to identify collisions.

collidescientist

Next on the agenda was exiting the level which took a few steps. I wanted a keycard to be collected before exit was allowed and hope to retain these cards to open up colour coded doors in future levels. This takes us right back to the beginning of the year when setting up the key/door in our first Unity project. On top of this I also added an inventory list to store the item, the same as my walking simulator.

exitlvl

The collision detection to exit the level with key in hand was also added to the player controller script. I won’t repost all of the inventory scripts as again they have been covered before in older posts.

robotdemo2

Having gotten to the optional part of my checklist I attempted to make a particle system that identifies to the player a key has been picked up. I had spare time in class and decided to tinker.

keyparticle

I’m not super happy with it and need to tinker with it further to make it far more subtle, and also need to gain the knowledge of how to call upon it. Things to do, things to do! Be back next week for another update!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s