SlideShare ist ein Scribd-Unternehmen logo
1 von 11
 
MiniGames Rebuilding Three Classic Joe Linhoff Eugene Jarvis Darren Torpey
Missile Command, 1980 Atari
Learning Objectives ,[object Object],[object Object],[object Object]
Dynamic Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dynamic Infrastructure init  body  final ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Game Controller Class  Owns Game Objects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],// JFL 13 Aug 08 Game::Game(chr *name) : qeUpdateBase(name,0,GAMEID_GAME) { this->name = qeObjName(this->_oShared); LLMakeHead(&this->listOfGameThings); LLMakeHead(&this->listOfWorlds); LLMakeHead(&this->listOfBuildings); LLMakeHead(&this->listOfPlayers); LLMakeHead(&this->listOfBadGuys); LLMakeHead(&this->listOfPlayerProjs); LLMakeHead(&this->listOfBadGuyProjs); } // Game::Game() // JFL 18 Aug 08 void Game::final() {  // don't call directly, use objRemove() Game *game; if((game=Game::instance)) { gameZapList(&game->listOfBadGuyProjs); gameZapList(&game->listOfPlayerProjs); gameZapList(&game->listOfBadGuys); gameZapList(&game->listOfPlayers); gameZapList(&game->listOfBuildings); gameZapList(&game->listOfWorlds); gameZapList(&game->listOfGameThings); delete game; // free the C++ object Game::instance=0; // reset pointer } } // Game::final()
Game Objects ,[object Object],[object Object],[object Object],[object Object],// JFL 14 Aug 07 World::World(chr *name) { szcpy(this->name,sizeof(this->name),name,0); LLMakeNode(this,GAMEID_WORLD); SET3(this->xyzMin,-110,0,0); SET3(this->xyzMax,110,200,0); } // World::World() // JFL 14 Aug 07 int World::draw(void) { qefnDrawGrid(50,10); qefnDrawAxes(1); return 0; } // World::draw()
Owners Must Always  Guarantee Cleanup ,[object Object],[object Object],[object Object],[object Object],// JFL 18 Aug 08 void Game::final() {  // don't call directly, use objRemove() Game *game; if((game=Game::instance)) { gameZapList(&game->listOfBadGuyProjs); gameZapList(&game->listOfPlayerProjs); gameZapList(&game->listOfBadGuys); gameZapList(&game->listOfPlayers); gameZapList(&game->listOfBuildings); gameZapList(&game->listOfWorlds); gameZapList(&game->listOfGameThings); delete game; // free the C++ object Game::instance=0; // reset pointer } } // Game::final()
Zap & Zap List ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],// JFL 25 Jan 09 int gameZapList(LLNode *head) { LLNode *n; while((n=head->next)&&n->t) gameZap(n); return 1; // nonzero return assumed } // gameZapList() // JFL 25 Jan 09 int gameZap(LLNode *n) { // unlink the game object LLUnlink(n); // call destructor for game objects switch(n->t) { case GAMEID_INPUT:((Input*)n)->~Input();break; case GAMEID_CAMERA:((Camera*)n)->~Camera();break; case GAMEID_HUD:((HUD*)n)->~HUD();break; case GAMEID_WORLD:((World*)n)->~World();break; case GAMEID_BUILDING:((Building*)n)->~Building();break; case GAMEID_PLAYER:((Player*)n)->~Player();break; case GAMEID_PROJ:((Proj*)n)->~Proj();break; case GAMEID_BADGUY:((BadGuy*)n)->~BadGuy();break; default: BRK(); // add handler for type } // switch // free the memory delete (qe*)n; return 1; // nonzero return assumed } // gameZap()
Simple Doubly Linked C-Style Polymorphic Lists ,[object Object],[object Object],[object Object],[object Object],LLNode *n; BadGuy *bad; for(n=this->listOfBadGuys.next;n->t;n=n->next) { if(n->t!=GAMEID_BADGUY) continue; bad=(BadGuy*)n; // handle bad guy } // for ,[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Augeas
AugeasAugeas
Augeaslutter
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environmentDavid Landgren
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X ServerYasuhiro Asaka
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perldaoswald
 
Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012rivierarb
 
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Zyxware Technologies
 
Php Extensions for Dummies
Php Extensions for DummiesPhp Extensions for Dummies
Php Extensions for DummiesElizabeth Smith
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machinejulien pauli
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練Sheng-Hao Ma
 
Infrastructure as Data - PuppetConf 2013
Infrastructure as Data - PuppetConf 2013Infrastructure as Data - PuppetConf 2013
Infrastructure as Data - PuppetConf 2013Puppet
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and runningTimo Sulg
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foobrian_dailey
 
Python Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding StylePython Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding StyleShuen-Huei Guan
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friendajacksified
 

Was ist angesagt? (20)

Lalal
LalalLalal
Lalal
 
Augeas
AugeasAugeas
Augeas
 
Using MySQL in a web-scale environment
Using MySQL in a web-scale environmentUsing MySQL in a web-scale environment
Using MySQL in a web-scale environment
 
gitfs
gitfsgitfs
gitfs
 
Hachiojipm11
Hachiojipm11Hachiojipm11
Hachiojipm11
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perl
 
XML::Liberal
XML::LiberalXML::Liberal
XML::Liberal
 
Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012
 
Making a simple jQuery plug-in
Making a simple jQuery plug-inMaking a simple jQuery plug-in
Making a simple jQuery plug-in
 
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
 
Php Extensions for Dummies
Php Extensions for DummiesPhp Extensions for Dummies
Php Extensions for Dummies
 
Php engine
Php enginePhp engine
Php engine
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
 
Infrastructure as Data - PuppetConf 2013
Infrastructure as Data - PuppetConf 2013Infrastructure as Data - PuppetConf 2013
Infrastructure as Data - PuppetConf 2013
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and running
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
 
Python Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding StylePython Programming in Entertainment Industry: Coding Style
Python Programming in Entertainment Industry: Coding Style
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friend
 

Andere mochten auch

Q-Learning and Pontryagin's Minimum Principle
Q-Learning and Pontryagin's Minimum PrincipleQ-Learning and Pontryagin's Minimum Principle
Q-Learning and Pontryagin's Minimum PrincipleSean Meyn
 
DeepHack.Game 5vision team
DeepHack.Game 5vision teamDeepHack.Game 5vision team
DeepHack.Game 5vision teamDeepHackLab
 
DeepHack.Game Skynet team
DeepHack.Game Skynet teamDeepHack.Game Skynet team
DeepHack.Game Skynet teamDeepHackLab
 
Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...
Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...
Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...Greg Makowski
 
Introduction to Reinforcement Learning
Introduction to Reinforcement LearningIntroduction to Reinforcement Learning
Introduction to Reinforcement LearningEdward Balaban
 
Reinforcement ppt assignment
Reinforcement ppt assignmentReinforcement ppt assignment
Reinforcement ppt assignmenthailnur1794
 
Reinforcement learning
Reinforcement learning Reinforcement learning
Reinforcement learning Chandra Meena
 

Andere mochten auch (9)

Learning Through Gaming
Learning Through GamingLearning Through Gaming
Learning Through Gaming
 
Q-Learning and Pontryagin's Minimum Principle
Q-Learning and Pontryagin's Minimum PrincipleQ-Learning and Pontryagin's Minimum Principle
Q-Learning and Pontryagin's Minimum Principle
 
DeepHack.Game 5vision team
DeepHack.Game 5vision teamDeepHack.Game 5vision team
DeepHack.Game 5vision team
 
DeepHack.Game Skynet team
DeepHack.Game Skynet teamDeepHack.Game Skynet team
DeepHack.Game Skynet team
 
Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...
Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...
Using Deep Learning to do Real-Time Scoring in Practical Applications - 2015-...
 
Generalized Reinforcement Learning
Generalized Reinforcement LearningGeneralized Reinforcement Learning
Generalized Reinforcement Learning
 
Introduction to Reinforcement Learning
Introduction to Reinforcement LearningIntroduction to Reinforcement Learning
Introduction to Reinforcement Learning
 
Reinforcement ppt assignment
Reinforcement ppt assignmentReinforcement ppt assignment
Reinforcement ppt assignment
 
Reinforcement learning
Reinforcement learning Reinforcement learning
Reinforcement learning
 

Ähnlich wie Gdc09 Minimissile

Unit 8
Unit 8Unit 8
Unit 8siddr
 
Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018
Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018
Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018Codemotion
 
Data Driven Game development
Data Driven Game developmentData Driven Game development
Data Driven Game developmentKostas Anagnostou
 
Unit 6
Unit 6Unit 6
Unit 6siddr
 
[EN] Ada Lovelace Day 2014 - Tampon run
[EN] Ada Lovelace Day 2014  - Tampon run[EN] Ada Lovelace Day 2014  - Tampon run
[EN] Ada Lovelace Day 2014 - Tampon runMaja Kraljič
 
Parallel Futures of a Game Engine
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game EngineJohan Andersson
 
Unit 4
Unit 4Unit 4
Unit 4siddr
 
Java Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvJava Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvAnton Arhipov
 
Python Workshop
Python WorkshopPython Workshop
Python Workshopkbhat95
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoSF
 
Barely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationBarely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationAttila Balazs
 
Csphtp1 18
Csphtp1 18Csphtp1 18
Csphtp1 18HUST
 
Jsonsaga
JsonsagaJsonsaga
Jsonsaganohmad
 

Ähnlich wie Gdc09 Minimissile (20)

Unit 8
Unit 8Unit 8
Unit 8
 
Php Sq Lite
Php Sq LitePhp Sq Lite
Php Sq Lite
 
Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018
Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018
Meetup di Gruppo Game Jam Roma - Giorgio Pomettini - Codemotion Rome 2018
 
Rust & Gamedev
Rust & GamedevRust & Gamedev
Rust & Gamedev
 
C to perl binding
C to perl bindingC to perl binding
C to perl binding
 
Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 
Data Driven Game development
Data Driven Game developmentData Driven Game development
Data Driven Game development
 
Unit 6
Unit 6Unit 6
Unit 6
 
All things that are not code
All things that are not codeAll things that are not code
All things that are not code
 
[EN] Ada Lovelace Day 2014 - Tampon run
[EN] Ada Lovelace Day 2014  - Tampon run[EN] Ada Lovelace Day 2014  - Tampon run
[EN] Ada Lovelace Day 2014 - Tampon run
 
Parallel Futures of a Game Engine
Parallel Futures of a Game EngineParallel Futures of a Game Engine
Parallel Futures of a Game Engine
 
Unit 4
Unit 4Unit 4
Unit 4
 
Java Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lvJava Bytecode Fundamentals - JUG.lv
Java Bytecode Fundamentals - JUG.lv
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
Fantom and Tales
Fantom and TalesFantom and Tales
Fantom and Tales
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)
 
Barely Legal Xxx Perl Presentation
Barely Legal Xxx Perl PresentationBarely Legal Xxx Perl Presentation
Barely Legal Xxx Perl Presentation
 
Csphtp1 18
Csphtp1 18Csphtp1 18
Csphtp1 18
 
Groovy
GroovyGroovy
Groovy
 
Jsonsaga
JsonsagaJsonsaga
Jsonsaga
 

Mehr von Susan Gold

Mehr von Susan Gold (20)

Community
CommunityCommunity
Community
 
ICEC
ICECICEC
ICEC
 
Dgxpo
DgxpoDgxpo
Dgxpo
 
Fog
FogFog
Fog
 
Ivdc
IvdcIvdc
Ivdc
 
Gold And Robinson 2009
Gold And Robinson 2009Gold And Robinson 2009
Gold And Robinson 2009
 
GDC 2009 Game Design Improv
GDC 2009 Game Design ImprovGDC 2009 Game Design Improv
GDC 2009 Game Design Improv
 
Setup
SetupSetup
Setup
 
Qe Reference
Qe ReferenceQe Reference
Qe Reference
 
Pong
PongPong
Pong
 
Missilecommand
MissilecommandMissilecommand
Missilecommand
 
Gdc09 Minipong
Gdc09 MinipongGdc09 Minipong
Gdc09 Minipong
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
 
Assignment Pong
Assignment PongAssignment Pong
Assignment Pong
 
Global Game Jam Overview
Global Game Jam OverviewGlobal Game Jam Overview
Global Game Jam Overview
 
Agd Talk Speed Run
Agd Talk   Speed RunAgd Talk   Speed Run
Agd Talk Speed Run
 
SIGGRAPH 2007 IGDA Presentation
SIGGRAPH 2007 IGDA PresentationSIGGRAPH 2007 IGDA Presentation
SIGGRAPH 2007 IGDA Presentation
 
Mscruise
MscruiseMscruise
Mscruise
 
GDC China 2007
GDC China 2007GDC China 2007
GDC China 2007
 
Digra07
Digra07Digra07
Digra07
 

Gdc09 Minimissile