ROOM 2+ FEATURES A-CREEPIN’ BEFORE WE START: LANYARDS RECAP ALL HERE?

Slides:



Advertisements
Similar presentations
A complete citation, notecard, and outlining tool
Advertisements

Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
GameCamp! and Game Davis Introduction to Unity®
HELLO WORLD: YOUR FIRST PROGRAM CHAPTER Topics  Hello World?  Creating a Unity Project –The Unity Project Folder  MonoDevelop: Unity's Code Editor.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Microsoft Office Word 2003 Tutorial 1 Creating a Document.
Geo II ch 5 Edited 10/14/05 1 GPS- Collecting Data Now that you have your data dictionary loaded, let’s configure the unit and take it outside! RECOMMENDED:
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
GISMO/GEBndPlan Overview Geographic Information System Mapping Object.
Congratulations on installing Let’s take a quick tour of the main features.
CHAPTER 2 The Game Loop - Variables, Types, Classes and Objects in XNA XNA Game Studio 4.0.
GameDevClub CODE CHEAT SHEET NOTE: ALL OF THE CODE IS CASE-SENSITIVE AND THE SYNTAX IS STRICT SO A LOT OF YOUR ERRORS WILL PROBABLY COME FROM TYPOS If.
Prezi A GUIDE FOR STUDENTS. What kind of do you have? For school addresses, click HERE and follow the directions.HERE For non-school .
Congratulations on installing Let’s take a quick tour of the main features.
World of Wokcraft The very best in Single pan cooking themed fantasy gaming!
Texas Skyward User Group Conference Helpful Hints Jennifer Speulda.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
World of Wokcraft The very best in Single pan cooking themed fantasy gaming!
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
DAY 4. MAKING SOMETHING ‘JUMP’ Simple! Move it a certain amount ‘up’ Glide back to your original spot.
Introduction to Articulate Studio Candace Chou University of St. Thomas Updated Sep. 28,
Digital Game Design ACST 3710 Your First Unity Program 1.
Under the direction of Susan Rodger
Class-Level Variables in Alice
EEC-693/793 Applied Computer Vision with Depth Cameras
Games Programming in Scratch
Working in the Forms Developer Environment
Lesson 1 - Sequencing.
FLOWCHARTS Part 1.
EEC-693/793 Applied Computer Vision with Depth Cameras
How to develop a presentation portfolio in Foliotek
Lesson 1 An Introduction
Microsoft® Office FrontPage® 2003 Training
Congratulations on installing
Understanding Agent Knowledge through Conversation
IF statements.
User guide for Direct Observations equipment use
Kodu Game Lab Shaw STEM Lab-2016.
Under the direction of Susan Rodger
Character Selection from a lobby in Unity
Diamond Hunt Mock Programming Project.
Let's Race! Typing on the Home Row
OverDrive Digital Library Basics
EEC-693/793 Applied Computer Vision with Depth Cameras
MS PowerPoint 2010 Week 2.
OverDrive Digital Library Basics
By Sanjay and Arvind Seshan
CSG Character flow Spec.
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
File Handling Programming Guides.
Introduction to TouchDevelop
UNITY TEAM PROJECT TOPICS: [1]. Unity Collaborate
Google Slides Fundamentals
Academic Communication Lesson 3
Story time Task 5 Computer Programming Gray , Calibri 24
Go to =>
Unit 11 – PowerPoint Interaction
By Sanjay and Arvind Seshan
Week 6: Time and triggers!
Win 10 Training This training is designed to be simple to follow and a hands on experience for the teachers. I would suggest you bring your teachers to.
Google Drive ~ A Look at Cloud Storage
Support for parents and guardians
EEC-693/793 Applied Computer Vision with Depth Cameras
Chapter 9 Using Decisions to
CIS125GA_03 Things that help
Presentation transcript:

ROOM 2+ FEATURES A-CREEPIN’ BEFORE WE START: LANYARDS RECAP ALL HERE? SPOT THE SPELLING MISTAKES!

GOALS By the end of the session you should: Discuss activity diagrams Add new features to the walking simulator Experiment with variables Create your own activity diagram Pitch the next game mechanic

Activity diagrams can be used to help represent the flow of a program. The key ACTIVITY DIAGRAM Activity diagrams can be used to help represent the flow of a program. In your games, they can help you make sense of behaviour and code for individual objects or specific functions. For example, the diagram on the right shows the behaviour of the key object. Player clicks on the key Destroy the key Rotate the door controlled by this key

The solid circle represents the starting point of the diagram. The key ACTIVITY DIAGRAM The solid circle represents the starting point of the diagram. Consider this the entry point of your code – the start of a function or the beginning of the game logic. Player clicks on the key Destroy the key Rotate the door controlled by this key

Rounded rectangles show actions. The key ACTIVITY DIAGRAM Rounded rectangles show actions. Actions are things that can potentially happen while your code/game is running. Player clicks on the key Destroy the key Award 5 points to the player Rotate the door controlled by this key

The key ACTIVITY DIAGRAM A solid circle within another circle shows the end/exit point of the activity diagram. Exit points are reached when the flow through activities and decisions has finished. A complicated diagram could have multiple exit points to make it easier to read. Player clicks on the key Destroy the key Rotate the door controlled by this key

The key ACTIVITY DIAGRAM Arrows show the flow through an activity diagram. They link the start and end points via actions and decisions. Arrows should be 1 directional. If actions and decisions need to be revisited, separate arrows are used to show the 2 way flow. Player clicks on the key Destroy the key Rotate the door controlled by this key

Let’s bring this diagram to life in code. Flashlight ACTIVITY DIAGRAM Let’s bring this diagram to life in code. Load up your walking simulator! Player presses F Toggle the light’s intensity between 0 and 1

THE LIGHT Create a new Spotlight from the Light section of the GameObject menu. Make the light a Child of the camera in your first person controller. Change the light’s Shadow Type from No Shadows to Soft Shadows. You may wish to lower the Intensity of other lights in the scene.

CODE Create a new C# Script called Flashlight. Add the script to the Spotlight. Load the script up in MonoDevelop.

VARIABLES Variables allow you to store information. As the name suggests, information in a variable can be changed. For Unity to be able to store some information, it needs to know what data type the information will be.

VARIABLES

VARIABLES Create a public variable in your new script by typing the following line just above its default Start function: public Light flashlight; Note: the data type of this variable is Light and the variable name is flashlight.

VARIABLES Save the script and select your Spotlight. You should now be able to tell the Flashlight component which light to use, thanks to the public variable you made. Drag the Light component into the slot.

CODE Time to control that Flashlight. Delete the Start function and add the following to the Update function: if (Input.GetKeyDown(KeyCode.F)) { // Flip the intensity between 0 and 1 flashlight.intensity = 1 - flashlight.intensity; }

IF What just happened?!

IF You just asked a question with code. More specifically, you asked if the player had pressed the F key down in this frame. If (or conditional) statements are a core part of coding and will let you make informed decisions in your game logic.

Diamonds represent decisions (ifs). The key ACTIVITY DIAGRAM Diamonds represent decisions (ifs). Decisions should have (at least) 2 arrows directing away from them. These arrows are annotated to explain why they would be followed. Player clicks on the key Player near key Player far away Destroy the key Rotate the door controlled by this key

IF

The key BONUS: INVENTORY Slides from here are an optional bonus and can be found on the shared Google Drive. Use your time making sense of the new content, reading up on the more technical aspects and trying to code something new.

The key BONUS: INVENTORY Inventory Item Door Controller Player clicks this door Inventory contains key item Inventory does not contain key item Player clicks on the key Rotate this door Destroy the item Destroy this script (not the whole game object) Add item to inventory

INVENTORY Create 3 new C# Scripts: Inventory - to store held items InventoryItem - to control the items DoorController - controls doors with items

INVENTORY Inventory should be put on one main object (such as the player) and contains a single line of code to store all collected items: public List<string> items = new List<string>(); but it needs an extra using line too: using System.Collections.Generic;

INVENTORY InventoryItem is placed on collectible objects. The itemName variable is stored in the inventory list when this item is clicked on. public string itemName; void OnMouseDown() { // Find the Inventory controller Inventory inventory = GameObject.FindObjectOfType<Inventory>(); // Add this item to the inventory inventory.items.Add(itemName); // Destroy (pick up) this item Destroy(gameObject); }

INVENTORY DoorController is used on doors that require a specific inventory item to open. keyItemName must match one of the InventoryItem’s itemName variables or it will never open. See the next slide for the full code.

INVENTORY // The name of the object that controls this door public string keyItemName; void Update () { // Find the InventoryController Inventory inventory = GameObject.FindObjectOfType<Inventory>(); // Does the inventory list contain the key item? if (inventory.items.Contains(keyItemName) == true) { // Rotate this door transform.Rotate(0,80,0); // Destroy this script Destroy(this); }

The key BONUS: INVENTORY Try this one! Door Controller Player clicks this door Player is near the door Player is not near the door Inventory contains key item Rotate this door Destroy this script (not the whole game object) Inventory does not contain key item

SOLO Develop your walking simulator further. Consider: Extra models - practice Matt’s stuff! Extra code - can you create your own components based on code to date? Experimentation! Play around with Unity’s features. Video tutorials, straight from Unity. https://unity3d.com/learn/tutorials/topics/scripting