Tuesday 19 April 2016

One Room #8 - Games Production 15/16

I decided it was about time to add some code into the game. Now before I go any further I think it's best to mention that I am no way near the best at coding and I can only just achieve what I want.
To start off I created a very basic state machine that would control how and when the different stages of the game would happen. Overall I ended up with roughly 20 scripts, some only a few lines long but I will briefly go over what each one does to show my understanding.


This is the door script, this allows the player to click the left mouse button to open the door to the ending.

Door

This script opens the drawer on the bedside cabinets.
Drawer

This script acts like a bool, I attach it to an object that has a code on and it will then active that code in the inventory.
Has the code

This is the Input Manager this tells other scripts what I am looking and or clicking on.
Input Manager



Interact

This is the Inventory Manager, when the player presses the 'I' key it stops the movement controller
Inventory Manager



Level Manager

Movement Manager

This plays the main music for our game, when its turned off it simply mutes the song so that it can be turned back on mid way through the song, sort of like a real radio.
Music Player

This script allows the player to pickup, drop and throw the objects in the room. this is the script that I am most proud of.
Pickup 1

Pickup 2

Pickupable

Old Pickup

This is the script that plays the intro at the very start of the game. I also added controls so that the player can pause or skip the intro.
Play Video (Intro)

State Machine

Static TV Screen

No comments:

Post a Comment