By Polyscape Games
I collaborated with a team of 12 to develop a co-op video game for mobile device and VR headset platforms. One player uses the Oculus Rift to become the “Prophet” and the other player uses a tablet to become the “God of Knowledge”. Since both players have different views of the game world, they need to communicate and work together to solve puzzles that subjugate the “Realm of the Gods” and beat the game.
I mainly focused on creating C# code for player actions of the VR player and game object interactions. This involved setting up a ray cast (seen as the green line in the image below for debugging) to project from the middle of the player’s camera to detect what was in the player’s line of sight.
Screenshot of Object Highlighting with Raycasting
I also created an ObjectGameplay class and specified subclasses (ObjectInteractable, ObjectPickUp, ObjectPlaceable) for all game objects that can be used during the game. So, if the object the player is seeing is centered on the screen and is part of the gameplay, the player can then press an action button on a controller or keyboard to interact with the object.
UML Diagram of Objects Used for Gameplay
And, I coded for several outcomes of object interactions as well. Outcomes include changing the position of an object or the player; loading in a prefab at a certain position; and disabling or enabling certain rooms, depending on which room the player was in, as seen in the video below.