SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Mobile Development Introduction to Visual Studio Development Rob Miles Department of Computer Science.
SE 320 – Introduction to Game Development Lecture 5: Programming in Unity & Developing Simple Games Lecturer: Gazihan Alankuş Please look at the last two.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Using Animation and Multimedia Lesson 9. Software Orientation The Animation Pane, shown at right, enables you to manage all the animation effects on the.
SE 313 – Computer Graphics Lecture 14: Armatures Lecturer: Gazihan Alankuş 1.
Microsoft Windows Vista Chapter 6 Customizing Your Computer Using the Control Panel.
HELLO WORLD: YOUR FIRST PROGRAM CHAPTER Topics  Hello World?  Creating a Unity Project –The Unity Project Folder  MonoDevelop: Unity's Code Editor.
1 Flash Programming Introduction Script Assist. 2 Course Description This course concentrates on the teaching of Actionscript, the programming language.
Introduction to Visual Basic. What is Visual Basic? An environment for developing Windows applications Components –A GUI (Graphical User Interface - gooey)
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Roentgen photo effect. This detailed, thoroughly explained lesson will show you how to create very attractive roentgen photo effect. You can use this.
Microsoft ® Office PowerPoint ® 2003 Training Playing movies [Your company name] presents:
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Software Development. Chapter 3 – Your first Windows 8 app.
Google Earth How to create a Google Earth Tour and place it in your Wiki.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
SE 320 – Introduction to Game Development Lecture 11: Animations and GoKit Lecturer: Gazihan Alankuş Please look at the last slides for assignments (marked.
SE 313 – Computer Graphics Lecture 11: Projection Painting and Merging Textures Lecturer: Gazihan Alankuş 1.
SE 313 – Computer Graphics Lecture 10: More Modeling and Texturing Lecturer: Gazihan Alankuş 1.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
1 Windows Printing. 2 Objectives You will be able to Output text and graphics to a printer. Print multipage documents. Use the standard Windows print.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
Jing Capture, record, and share instantly.. Some ways to use Jing (by TechSmith) Add visuals to your online conversations!
SE 320 – Introduction to Game Development Lecture 4: Programming in Unity & Project Presentations Lecturer: Gazihan Alankuş Please look at the last two.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
SE 350 – Programming Games Lecture 6: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Introduction to Scratch!
Introduction to the WebBoard Terry Dennis. The WebBoard - Our Connection The WebBoard URL is
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Chapter 2 Adding Animation to a Presentation. Applying Animation Animation is a great way to add life to InDesign documents by making objects: – move.
Introduction to Matlab & Data Analysis
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Introduction to Windows Programming
SE 313 – Computer Graphics Lecture 6: Transformations Lecturer: Gazihan Alankuş Please look at the last three slides for assignments (marked with TODO)
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
Motion Tweening – Lesson 81 Motion Tweening Lesson 8.
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
SE 320 – Introduction to Game Development Lecture 3: Unity’s Interface and Concepts Lecturer: Gazihan Alankuş Please look at the last two slides for assignments.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
1 Flash Basics Exercise Guide Making Animated Text  1.1 Open Flash 5.0 working environment frame 1  1.2 Highlight frame 1 of the first layer Insert.
Mobile Programming Lecture 3 Debugging. Lecture 2 Review What widget would you use to allow the user to enter o a yes/no value o a range of values from.
Hannah Hobi IT 442 February  MENU  What is Screencast-O-Matic? What is Screencast-O-Matic?  How easy is it to use? How easy is it to use?  How.
Quick Flash Tips Learn how to use flash the easier way!
Flash animation For beginners. homework Your homework is over two weeks so please write in each week of your planner for the next two weeks For homework.
Tutorial 7 Creating Animations. XP Objectives Learn about animation Create a timeline Add AP divs and graphics to a timeline Move and resize animation.
CIS 205—Web Design & Development Flash Chapter 3 Appendix on Using Buttons.
Open a new Flash File Action Script 2.0. Create a button like you did last lesson and name it Click to Play.
SE 350 – Programming Games Lecture 5: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Introduction to TouchDevelop Lesson 3 – Comments & Lists Created by S. Johnson
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
21/03/ Working with Controls Text and List Boxes.
Computer Graphics Imaging Lecture 13 and 14 UV Mapping.
Introducing Scratch Learning resources for the implementation of the scenario
Digital Literacy Introduction to Computers Unit 1, Lesson 1.
 Motion Tween allow us to move a shape on the stage from one place to another.  In order to use motion tween, the shape to be moved must be converted.
Digital Game Design ACST 3710 Your First Unity Program 1.
Microsoft Access Illustrated
Introduction to Object-Oriented Programming
Flash animation For beginners.
UNITY TEAM PROJECT TOPICS: [1]. Unity Collaborate
Computer Animation UV Mapping.
Using Animation and Multimedia
Presentation transcript:

SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides for assignments (marked with TODO) 1

Topics Today Animations – Sources – Scripting GUIs – GUIText and GUITexture – OnGUI magic Debugging – Really debugging with breakpoints in MonoDevelop – Making the game pause before the next Update with Debug.Break() Visual Studio and ReSharper 2

Animations Why do we need them? – Setting position/rotation in the Update() function can be limiting – Sometimes you want to visually design how things will move What are they? – Some motion information in a component called Animation Where do they come from? – Create visually in Unity Unity Window->Animation – Create in modeling/animation tools Blender, 3DS Max, Maya, etc. How can we use them? – In code, you tell Unity which animation to start The “activate trigger” script is an example 3

Update() vs. Animations In Update(), you can animate objects by setting their properties in code (location, rotation, scale, etc.) – Pros Your calculations can be advanced (procedural animations, etc.) Motions can depend on user input or other events in the game – Cons For simple motions it can be too much work – E.g., a platform that does the same motion over and over It can be difficult to adjust the motion so that it is – visually pleasing – exactly how you want it to be 4

Update() vs. Animations With animations, you can visually design how things will move – Pros It’s easier to make things move how exactly you want them to It’s easy to adjust speeds throughout the motion, implement curved motions and make motions visually pleasing – Cons Static motions, cannot react to user input or other events in the game (blending, switching, mixing can help) 5

Animations in Unity You record the motion You start playing that motion in game 6

Animations in Unity You record the motion You start playing that motion in game 7

Recording Animations in Unity Window -> Animation opens the Animation pane Add an animation component to the game object you want to animate (or let Unity do it for you while recording) 8

The Animation Pane 9 timeline (can drag with mouse) curve for z (position in time) keyframes (pinned values in time) record, play, etc. other objects in your scene

Keyframe Animation “I want the bus to be at this bus stop at 7:40, then I want it to be at this other bus stop at 7:45” – The bus driver does whatever is necessary to obey this. You say “I want my cube to be here at time 0, I want it to be there at time 5, I want it to be there at time 8” – Unity calculates the motion that is necessary to make it happen 10

Example 11

How to Create a Keyframe Animation 1.Select the object you want to animate 2.Open the animation pane and press record (top-left corner) 3.Make your object how you want it at the beginning of the animation 4.Drag to a future time 5.Move/rotate/scale the object to how you want it at this time 6.Repeat 4-5 until you are done. Any time, you can drag time or press play to review the current state of the animation 12

Some Details Pressing the record button – automatically adds an animation component if the object does not have one already – adds a new animation file if there was not one already in the animation component You can have many animations for an object – In code you can play any of them, blend between them, etc. Practice with the animation pane to find alternative ways of doing things (adding keyframes manually, dragging keyframes, etc.) 13

Animations in Unity You record the motion You start playing that motion in game 14

How to Play Animations Automatically (easiest) – When “Play Automatically” is checked, Unity will play the animation in the “Animation” property. From code – animation.Play(“animationName"); – animation.CrossFade(“animationName2"); – Read the entry for the Animation class in the scripting reference Can change speed, stop, mix, etc. 15

Animations vs. Update() Animations are static but easy, you tell them to play and they play for many frames Changing position in every Update() call is messy Is there anything in between? – Yes! Tweening. GoKit: GoKit-Tween-Library-Livehttps://github.com/prime31/GoKit GoKit-Tween-Library-Live 16

GoKit Tell Unity to move an object to a certain point in four seconds, without having to do it in the Update() function – transform.positionTo(4f, new Vector3(10, 10, 10 )); Many options to make it prettier. Look at the wiki –

Topics Today Animations – Sources – Scripting GUIs – GUIText and GUITexture – OnGUI magic Debugging – Really debugging with breakpoints in MonoDevelop – Making the game pause before the next Update with Debug.Break() Visual Studio and ReSharper 18

GUIs Display scores, lives, etc. Any kind of textual or image-based output on the screen. GUIText and GUITexture – Add them through Game Object -> Create Other. Can be difficult to make them work otherwise. – Call their functions to do whatever you want to do with them guiText.text = newScore + “ points”; //for example 19

More Complex GUIs OnGUI() function of MonoBehavior – This is not the kind of functions you are used to! – Unity does unusual things with it. You have to read the documentation carefully. Calls it every frame but creates only in the beginning void OnGUI () { if (GUI.Button(new Rect (10,10,150,100), "I am a button")) { print ("You clicked the button!"); } 20

GUIs You can use buttons for input (menus, etc.) You can use text and images for output. 21

Topics Today Animations – Sources – Scripting GUIs – GUIText and GUITexture – OnGUI magic Debugging – Really debugging with breakpoints in MonoDevelop – Making the game pause before the next Update with Debug.Break() Visual Studio and ReSharper 22

Debugging Debug.LogError Debug.LogWarning – These let you display messages that won’t get lost in many others Debug.DrawRay() Debug.DrawLine() – These let you draw things in the scene view to see what exactly is going on in the game Debug.Break() – This lets you make Unity pause itself after this frame 23

Debugging with MonoDevelop while Coding in Visual Studio at the Same Time Do this once after you created your Unity project – Edit->Preferences->External Tools is where you set the IDE that Unity will fire Select Visual Studio – Double-click a script, this will create the Visual Studio project Select MonoDevelop – Double-click a script, this will get the project in MonoDevelop’s recents Select Visual Studio again – Close everyting Do this at every run – Run MonoDevelop without running Unity – Select the project that is already in the recent projects – Run->Debug This will run Unity – Set a breakpoint in MonoDevelop and see how it stops at that breakpoint – Run Visual Studio by either running it from the start menu, Or ensuring Edit->Preferences->External Tools is Visual Studio and double clicking on a script. – This does not affect MonoDevelop 2/10/201224

The BEST Development Environment for Unity Scripting that I Know of Visual Studio + Resharper for coding – I asked for a classroom license. I also sent an . Still waiting. In the meantime go ahead and install the 30 day version. MonoDevelop for occasional line-by-line debugging (explained towards end of presentation) If you are using any other way, you would certainly develop a better game if you listen to me (If you disagree, talk to me before discarding my advice… I have worked on large projects.) 2/10/201225

No Homework! Good luck at the exam! 26