Study Guides (390,000)
CA (150,000)
SFU (5,000)
IAT (80)
IAT 167 (20)
Final

IAT 167 Study Guide - Final Guide: Collision Detection, Waypoint, Playtime


Department
Interactive Arts & Tech
Course Code
IAT 167
Professor
Jack Stockholm
Study Guide
Final

This preview shows pages 1-2. to view the full 8 pages of the document.
IAT 167 Notes
Week 4 Lecture 2 - Feb 3, 2011
OOP Concepts
Play Pokemon tower defend game
Leveling up as a way to motivate
Are stories important to TDG?
Oop concepts:
3 big:
•Encapuslation
•Inheritance
•Polymorphism
Encapsulation
Object can b a container for data and methods
Hide and restrict access to This data
Do you need a mutator, or can just change?
Accessor and mutator functs
A: allow class consumers read internal data
M: allow to change them
Class consumers: user of an object is the consumer
Ie, function that builds board based on info in objs
Access control:
Public - everything avail to everything, vis everwhere
Internal - Default if not public - avail to package
Multiple classes pos per package
Private - only same class
Reason: if someone updates var in your class, other stuff also happens - force them to
use mutator method
Protected - same was private, also derived classes
Static - same var between ALL objects
Same Obj shared between all
Accessors - get and set (A and M)
Get and set are keywords?
Not something we need to know
Inheritance
Class can use data of another class (super) and it becomes sub by adding own
functionality
Extends another class
Start w simple object, make more complex by extending
Base class, don't have to redefine stuff, easier to. Reuse
Polymorphism
Action or method can do diff things depending. On.Obj acted on
Can call the roll function of each wheel, and it can b e different. For each wheel
Overloaded: same sig, diff number parameters
Look at example
Override: write a new function that has same name as super class, use new one
instead of old one (same number parameters)
Class interfaces
What MUST be implemented by a class

Only pages 1-2 are available for preview. Some parts have been intentionally blurred.

Class def w no implementation
Don't think of GUI
All properties avail and accessable to outside world
public Interface IName {
function initiative: void
}
Create new classes with. This interface, MUST. Have. This. Data and functions
Can require multiple interfaces
Want to call everything in same way
ie, everything has update function, can loop and update all at once
Frame work
Start game
Init fictions (gets calls once)
Start level
Level setup functs
Game loop
Update
Render
Game end
Dispose
Homework
Make use block class for everything
Get rid of empty and direct blocks
Child should never tell parent what to do
Don't let class Obj know about parent
Every block checks if game is over - STUPID
Don't add whole libraries, add what you need
He also casted his varibles, and didn't scope them
Week 5 - Lecture 1: Game Time and Flow
Also movement, as well as time and its perception, animation flow
Friday - attacker code to work on over reading break (refactor code base)
Homework Review:
Constructor can have return type.void, or nothing
Declare, instanciate it (filling Obj var w/ a value)
Static: don't need an instance, same reference always
Does static require constant?
Event listeners to call functions - useful for web, kind of - allows to make sure stuff
loads before you do stuff
This refers to the object itself
Classes just a definition until you instanciate it
Break fully exits switch statement
After case satisfied, run code until hit break
Use interface with "implements"
Colour can be a uint?
You're Reading a Preview

Unlock to view full version

Only pages 1-2 are available for preview. Some parts have been intentionally blurred.

His code: pass in value from level array. Don't actually need switch.
Shouldn't have called render internally
Can also use inheritance for blocks
Game Time:
Two types: play time (objective), event time (time in game)
Activity of player changes state (required for play)
Can be 1 to 1, can not be (MM?)
Don't want to feel like wasting time
Relationship between ability and difficulty important to time - want flow
Lose concept of play time, perfectly matched ability and difficulty
Objective time becomes event time
Game challenge: no obviously best choice
ie, puzzle game with obvious soln (except lvl 0)
Want strategy - more value in some choices than others
Need to be able to make these choices
Bridge: UML of TD game (code diagram)
Reading wk bridge: explore win/loss mechanics, challenge
How is flow achieved in 3 mechanics?
Think of additional mechanics you'd like to implement
Week 5 - Lecture 2 – Motion
Motion Calculation - From reading
Midterm: ask best option from example, write single lines of code, lots like quiz, will try
to open quizes, def some terminology questions, but more code eval
User events can interrupt game loop
Animation Techniques:
can be time or frame based
Time allows to ensure smooth motion
If frame advancing slow down, might get too few frames per second
Updates not continuous
Tiny changes in speed add up over time
Both slow and fast cmpts cause issues
Problematic period
Other options too:
Keep updating, reduce render frequency, skip render options until back on time
(can't skip too often)
Don't need to update faster than 25fps anyways, reduce update frequency,
give more CPU to render
Map
Obj should know about anything other than self, should just be controlled and
used by outside code. Can pass in models, however.
Current map reply is still not best, but whatever
All empty=0
All road = 1
Waypoints - whenever change direction, increment; results in 2 digit numbs
You're Reading a Preview

Unlock to view full version