Video Games & Object
Oriented Programming
Games
What are Games?
Not a Game
MovieNo active player participationFixed final outcome
ToyPlay with a toy, but not with a gameNo predefined goals, no notion of winning
PuzzlePuzzles are staticGames are dynamic and change in the course of playing
Is SimCity a game?
Games Are:
A Structured activityPlayed for FunOften involves CompetitionHas specific RulesAnd is generally Interactive
Video Game Genre
Genres classify different types of games
Examples:
Adventure Arcade
Fighting MMO
Music Party
Puzzle Racing
Role Playing Shooter
Management Sports
How Do We Make a Video Game?
WithProgramming
!
What is Programming?
A sequence of instructions intended for a computer to follow is a program
Programming is the process of creating a program
What is Object-Oriented Programming?Object-oriented programming is
creating programs using objects.
Objects are created as classes and have methods and properties.Classes tell how to make an object.Methods tell objects to perform actions.Properties tell information about objects.
Example: The Cat Class
What methods would a cat have?
eat
purr
meow
What properties would a cat have?
name
color
age
These methods and properties define the
Cat class.
Other Programming Elements…
Conditional Logic - Using if-then-else logic structure to describe a potential chain of events, based on a given set of rules.
Variables - Variables are symbols that hold value or represent some other thing.
Algorithms - The construction of a plan of action.
Debugging - Diagnosing errors in logic or behavior. This usually involves fixing rules or mechanics that are malfunctioning, or clarifying rules or strategies.
Video Game Design
Game Elements
Goals
Rules
Assets
Spaces
Play Mechanics
Scoring System
What is necessary to make a game?
In pairs, discuss one of the following:
a. Apples and Oranges: Compare and contrast any two individual games from within the same genre
b. Nuts and Bolts: Compare and contrast two individual games in two different genres of games. What makes each game an example of that genre?
c. Fruits and Veggies: Compare and contrast two whole genres. What are the core experiences of each genre? What makes them distinct and unique from each other, and how are they similar to each other?
Goals
Every system has some Goal, or something that it is trying to complete.
In games, the Goal is the win condition, or how the player wins the game.
Spatial goals – get to end of level
Task Oriented – complete the tri force
RulesRules can generally be defined by:Behavior for which the player will be punished.
In basketball, you cannot walk or run without dribbling the ball. This is called traveling, and the other team will get the ball.
Rules that restrict behavior.In chess, the player cannot move a pawn sideways or backwards. There is no punishment, as those are not valid
Moves; the Rules simply define the set of actions available to the players.
What’s the difference between Sonic and Mario?
Assets
Assets are all of the things in the game
landscape, trees, buildings,
sky, power- ups, weapons,
everything else that you can actually see in the game
The design of the Assets gives the game atmosphere and personality
Spaces
Spaces are where the game takes place.
Think of a game like Star Wars: The Old Republic. This game takes place in very tight, cramped, poorly-lit Spaces, where it becomes difficult to see and avoid enemies.
This increases the tension and the feeling of dread, which contributes to the games’ scariness and adds to the theme of the game.
Play Mechanics
Play Mechanics are the things that players DO in games.
If the Goal of the game tells the player how the player can win the game, the Play Mechanics provide the player methods for achieving that Goal.
They are the action words, like “run”, “jump”, “shoot”, “trade”, “take cover” or “upgrade my equipment”.
For example, in Mario, the player can run, jump, and throw fireballs in order to get to the end of the level, which is the Goal.
Let’s Get Started!
Coming After Lunch
Object Oriented
Programming
Writing a Program
Writing a program is just like solving any other kind of problem
What kind of steps do people use to solve problems?
Example: How do you make a cake?
Steps for Problem Solving
1. Read and understand the problem
2. Design solution
3. Implement solution
4. Test solution
5. Revise as needed
Step 1: Read & Understand
What is the problem you need to solve?What is all the relevant information?Do you need clarification?
In Game Design:What is the goal of my game?What assets do you need?What rules do my objects follow?What variables should I have?
Step 2: Design
Once you have all the information, you can begin to come up with an approach to solving the problem
Design your solution carefully on paper before making the real thing
Start with the overall big picture and then add in details
We will be using the Game Design Document
Step 3: Implement
Once you have your design follow it.Use the plans you have made for yourself. You may encounter the need to revise plans as you work
If the problems get to big, you may need to rethink your planning
In Game Development:Create the objects you listed in your design documentCreate a space and place the objectsin it appropriately
Step 4: Test
Make sure everything works the way you want/expectYou may discover problems you had not consideredDon’t wait until the very end to do thisGo back and forth between steps 3, 4 and 5 many times
Step 5: Revise
If at first you don’t succeed, try againFix any problems you encounter Testing frequently helps youfind the areas that need fixing
In Your GameThink about what is wrong, and how that is represented in your objects or in your environment, and then go try to fix itYou may need to try this many times