Intro to 3D Game Development

About this Course

The Game Editor

The Voxel Editor

Scripting Part 1: Moving Objects

Scripting Part 2: Making Code Respond to Players

Lessons

Introduction Create a New Script for the Chest Lid Name and Save the Script Rotate the Chest Lid Make a new Euler Variable Info: What is an Euler? Set the Goal for the Rotation Animation Create the Other Animation Variables Copy the Starting Rotation Find the Change in the Rotation Axis Info: A Word About Rotations Challenge: Rotate the Chest Lid Over Time Testing: Rotate the Chest Lid Over Time Solution: Rotate the Chest Lid Over Time Keep the Animation from Starting Automatically Testing: Turning the Animation On and Off Look For Unnecessary Computations Stop the Animation Code Info: Logical Operators ‘And’, ‘Or’, and ‘Not’ Challenge: Add a Stop to the Original Chest Script As Well Solution: Add a Stop to the Original Chest Script As Well Make a Function to Start the Chest Lid Opening Animation Testing: The Function to Start Opening the Lid Let the Chest Reference the Chest Lid Select the Chest Lid as the Entity Reference Find the Entity from an Entity Reference Send a Signal to the Chest Lid to Call the Start Animation Function Check that the Chest Lid Exists First Testing: Start the Animation Make a Separate Function for the Chest Opening Code Make a Boolean Variable to Track Whether the Chest is Open Rename the goalRotation and startRotation Variables Create a Function to Close the Chest Lid Challenge: Write the Code to Close the Chest Lid Testing: Write the Code to Close the Chest Lid Solution: Write the Code to Close the Chest Lid Rename the startOpeningLidAnimation Function Give the Function a Parameter Info: Function Parameters Make the Function Stop Early Info: Function Returns Change the Chest Script’s Send Event Make the Parameter Optional Conclusion Review

Scripting Part 3: Finishing the Game Loop

Lessons

Introduction Testing: Set the Animation Back Create or Remix a Dig Spot Add Your Dig Spot to the World Swap to Trigger Collision Info: Collision Types and Colliders Create a Script for the Dig Spot and Add Trigger Functions Testing: Trigger Functions Make the Trigger Bigger Find Out What Entered the Trigger Check if the Entity is a Player Challenge: Give the DigSpotScript an EntityRef to the TreasureChest Solution: Give the DigSpotScript an EntityRef to the TreasureChest Challenge: Make a Function on the ChestScript to Start Moving It Solution: Make a Function on the ChestScript to Start Moving It Challenge: Send an Event from the onTriggerEnter Function to the Chest Solution: Send an Event from the onTriggerEnter Function to the Chest Testing: Step on the Dig Spot to Activate the Chest Move the Chest Before it Animates Send the DigSpot’s Position with the Event Stop the Chest Animation from Repeating Use a Boolean Variable to Determine if the Spot Has Treasure Testing: With and Without Treasure Make a TreasureController Entity Create a TreasureController Script Give the DigSpot a Tag Find an Entity Using a Tag Testing: Make Sure You Found an Entity Copy the Dig Spot Testing: Count DigSpots by Tag Info: Arrays Make a Function to Set the hasTreasure Property Set One of the Spots to Have Treasure Testing: Exactly One Spot Has Treasure Generate a Random Number Randomize the Treasure Spot Info: the Math Library Make a Reset Function on the Chest Script Make a Function on the Treasure Controller to Reset the Whole Game Use a For Loop to Remove Treasure from All the Dig Spots Info: Loops Add a Reset Button Disable Play on the Button Animation Create a ButtonScript with Collision Events Testing: Collision Events Get a Reference to the VoxelObject Change the VoxelObject Animation Frame Testing: Changing Animation Frames with a Collision Event Challenge: Set the Animation Back Solution: Set the Animation Frame Back to 0 on the Collision Exit Event Challenge: Send an Event to the TreasureController to Reset the Game Solution: Send an Event to the TreasureController to Reset the Game Delete the TreasureController Voxel Object Conclusion Review