31
Video Games & Object Oriented Programming

Video Games & Object Oriented Programming. Games

Embed Size (px)

Citation preview

Page 1: Video Games & Object Oriented Programming. Games

Video Games & Object

Oriented Programming

Page 2: Video Games & Object Oriented Programming. Games

Games

Page 3: Video Games & Object Oriented Programming. Games

What are Games?

Page 4: Video Games & Object Oriented Programming. 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?

Page 5: Video Games & Object Oriented Programming. Games

Games Are:

A Structured activityPlayed for FunOften involves CompetitionHas specific RulesAnd is generally Interactive

Page 6: Video Games & Object Oriented Programming. Games

Video Game Genre

Genres classify different types of games

Examples:

Adventure Arcade

Fighting MMO

Music Party

Puzzle Racing

Role Playing Shooter

Management Sports

Page 7: Video Games & Object Oriented Programming. Games

How Do We Make a Video Game?

WithProgramming

!

Page 8: Video Games & Object Oriented Programming. Games

What is Programming?

A sequence of instructions intended for a computer to follow is a program

Programming is the process of creating a program

Page 9: Video Games & Object Oriented Programming. Games

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.

Page 10: Video Games & Object Oriented Programming. Games

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.

Page 11: Video Games & Object Oriented Programming. Games

Other Programming Elements…

Page 12: Video Games & Object Oriented Programming. Games

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.

Page 13: Video Games & Object Oriented Programming. Games

Video Game Design

Page 14: Video Games & Object Oriented Programming. Games

Game Elements

Goals

Rules

Assets

Spaces

Play Mechanics

Scoring System

Page 15: Video Games & Object Oriented Programming. Games
Page 16: Video Games & Object Oriented Programming. Games

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?

Page 17: Video Games & Object Oriented Programming. Games

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

Page 18: Video Games & Object Oriented Programming. Games

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.

Page 19: Video Games & Object Oriented Programming. Games

What’s the difference between Sonic and Mario?

Page 20: Video Games & Object Oriented Programming. Games

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

Page 21: Video Games & Object Oriented Programming. Games

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.

Page 22: Video Games & Object Oriented Programming. Games

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.

Page 23: Video Games & Object Oriented Programming. Games

Let’s Get Started!

Page 24: Video Games & Object Oriented Programming. Games

Coming After Lunch

Object Oriented

Programming

Page 25: Video Games & Object Oriented Programming. Games

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?

Page 26: Video Games & Object Oriented Programming. Games

Steps for Problem Solving

1. Read and understand the problem

2. Design solution

3. Implement solution

4. Test solution

5. Revise as needed

Page 27: Video Games & Object Oriented Programming. Games

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?

Page 28: Video Games & Object Oriented Programming. Games

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

Page 29: Video Games & Object Oriented Programming. Games

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

Page 30: Video Games & Object Oriented Programming. Games

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

Page 31: Video Games & Object Oriented Programming. Games

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