103
please fold an index card and write your 3 letter call-sign as a name card. Ready? anyone have a quarter? http://www.flickr.com/photos/robboudon/541896810 Need the files? https://github.com/robstenzinger/HTML5-Game-Dev-Workshop

Underwater Tomato Ninja - HTML5 Game Development & Design

Embed Size (px)

DESCRIPTION

Games give us other ways to think about tackling challenges from gardening to space battles. Why not play a game to make a game? In this hands-on workshop, game developer and cartoonist Rob Stenzinger will introduce you to HTML5 Game Development. Daedal Games Mega Mega Corp. needs your help to improve their latest game Underwater Tomato Ninja!

Citation preview

Page 1: Underwater Tomato Ninja - HTML5 Game Development & Design

please fold an index card and write your 3 letter call-sign as a name card.

Ready?anyone have a quarter?

http

://w

ww

.flic

kr.c

om/p

hoto

s/ro

bbou

don/

5418

9681

0

Need the files? https://github.com/robstenzinger/HTML5-Game-Dev-Workshop

Page 2: Underwater Tomato Ninja - HTML5 Game Development & Design

Underwater Tomato Ninja HTML5 Game Development & Design - a Daedal Mega

Mega Overdrive Games Production

rob stenzinger presents:

workshop ©2012 rob stenzingerthis slide deck licensed under creative commons

http://creativecommons.org/licenses/by/3.0/

Page 3: Underwater Tomato Ninja - HTML5 Game Development & Design

Games for Learning

dragons are

much safer in a

game

if available, dragon rental would be

rather expensive

http://www.flickr.com/photos/lilu12323/4028801424/sizes/l/in/photostream/

Page 4: Underwater Tomato Ninja - HTML5 Game Development & Design

Immersive Learning

http://www.flickr.com/photos/dnamichaud/372473978/sizes/l/in/photostream/

hidden slice

of pizza

stepped on what’s hopefully

a candy bar

Page 5: Underwater Tomato Ninja - HTML5 Game Development & Design

Warning

http://www.flickr.com/photos/msvg/2670767610/sizes/l/in/photostream/

brain.

shutting.

down.

so many informations

Page 6: Underwater Tomato Ninja - HTML5 Game Development & Design

Rob

lean into art Agz.megames, ux

makes games & comics

workshops & podcasts comicsconsulting

stenzinger

Page 7: Underwater Tomato Ninja - HTML5 Game Development & Design

Guitar Fretterhttp://guitarfretter.com

Page 8: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision!

chooseA BInstructions

Both instructions &

story

!

jump to page 12 jump to page 9

Page 9: Underwater Tomato Ninja - HTML5 Game Development & Design

Welcome to the trial-by-fire Apprenticeship at Daedal Mega

Mega Overdrive Games

we make games for anything and everything. page 9

Page 10: Underwater Tomato Ninja - HTML5 Game Development & Design

I'm Not Daedelus

*Just an every day purple dragon librarian, guide to the apprenticeships.

welcome, new talent!

Page 11: Underwater Tomato Ninja - HTML5 Game Development & Design

Daedal Mega Mega Overdrive Games

imagine sony, microsoft, nintendo, apple, all went voltron into one massive company.

this is a

rather large

building

miniscule.

Page 12: Underwater Tomato Ninja - HTML5 Game Development & Design

Rules of our Game Workshop Game

earn & collect achievements

vote where to go next

Questions and Crafting

page 12

Page 13: Underwater Tomato Ninja - HTML5 Game Development & Design

Achievements

Question Answer Craft your Game

Demo Your Game

Hidden

10pts 10pts 100pts 150pts 15pts

Q A C D H? !

Page 14: Underwater Tomato Ninja - HTML5 Game Development & Design

Get on the score board

got achievements? add your initials & score after game over!

Page 15: Underwater Tomato Ninja - HTML5 Game Development & Design

Ready?

this is a

ghost, not a

text editor Google Chrome’s Mascot*

* why let firefox have the only browser animal?

Need the files? https://github.com/robstenzinger/HTML5-Game-Dev-Workshop

Page 16: Underwater Tomato Ninja - HTML5 Game Development & Design

Run the Game

is there a ninja? is there water?

Page 17: Underwater Tomato Ninja - HTML5 Game Development & Design

chooseA BPlay for

Fun!

Play for research and

for fun!

!

jump to page 23 jump to page 18

Page 18: Underwater Tomato Ninja - HTML5 Game Development & Design

Play the Game for research

Take notes...

page 18

Page 19: Underwater Tomato Ninja - HTML5 Game Development & Design

Explore the Screens

credits game over

start game level

Page 20: Underwater Tomato Ninja - HTML5 Game Development & Design

Bugsarrrrrrrrrrrr! I

don’t think it’s

supposed to do that!

Page 21: Underwater Tomato Ninja - HTML5 Game Development & Design

Design Goalsthere should

be less

gravity and

more outer

space!

more kittens!

arrrrrrrrrrrr!the ninja be

needin’ to be fasterrrrr!

how about

birds, pigs,

and boxes to

smash?

Page 22: Underwater Tomato Ninja - HTML5 Game Development & Design

Questionswhy am I the bad guy?

pick the crab over there instead.

these are

castinets, buddy.

Page 23: Underwater Tomato Ninja - HTML5 Game Development & Design

Play for fun!

2 min time limit,

achievements to

scores > 10 and

top score!

page 23

http

://w

ww

.flic

kr.c

om/p

hoto

s/ru

ssel

lber

nice

/289

0790

642

Page 24: Underwater Tomato Ninja - HTML5 Game Development & Design

Workshop Game Start!

choose

A Cbreak the

codeLEARN ABOUT

CODING

--> Decision!

Btour the code,

then break the code

!

jump to page 27 jump to page 30jump to page 25

Page 25: Underwater Tomato Ninja - HTML5 Game Development & Design

Explore the Code & Editing Code Experience

page 25

Page 26: Underwater Tomato Ninja - HTML5 Game Development & Design

changing the code

change & save the code

Let’s Change the Game’s Title page

refresh the browser &

test the game

Page 27: Underwater Tomato Ninja - HTML5 Game Development & Design

Breaking It

break the code not the computer

http://www.flickr.com/photos/jupiterssj4/3954031705

page 27

Page 28: Underwater Tomato Ninja - HTML5 Game Development & Design

Google Chrome tells you what broke

and if it’s an error in JavaScript it’ll say WHERE it broke!

Page 29: Underwater Tomato Ninja - HTML5 Game Development & Design

Starting Over

http://www.flickr.com/photos/dps/7161557/sizes/m/in/photostream/

“the jolly, shiny, candy-like button...”

Page 30: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision!Time to Explore Coding!

chooseA Bintro to code

& coding for a web browser

coding for a web browser

!

jump to page 32 jump to page 36

page 30

Page 31: Underwater Tomato Ninja - HTML5 Game Development & Design

computers only know what you tell them

imagine i’m a computer!

Page 32: Underwater Tomato Ninja - HTML5 Game Development & Design

Intro to Coding

page 32

Page 33: Underwater Tomato Ninja - HTML5 Game Development & Design

Conditional logic

Page 34: Underwater Tomato Ninja - HTML5 Game Development & Design

Loops

Page 35: Underwater Tomato Ninja - HTML5 Game Development & Design

functions!

Page 36: Underwater Tomato Ninja - HTML5 Game Development & Design

Coding for a Web Browser

images

text

sound

css

html buttonsjavascript

an HTML page brings together many parts

page 36

Page 37: Underwater Tomato Ninja - HTML5 Game Development & Design

Intro to HTML, CSS, and Javascript

What kind of element

Element’s Class

Element IDstatus or situation of

the Element

Browser’s DOM: Document Object Model

cssjavascript

id: avatarclass: (none)

Type: DIVsituation: (varies)

Page 38: Underwater Tomato Ninja - HTML5 Game Development & Design

connecting css or javascript to html elements

document.getElementById(“avatar”)document.getElementsByClassName(“container”)

css

javascript

Page 39: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision!Game Design!

chooseA BLean about

the fun loopHow game design

is related to making comics

!

jump to page 40 jump to page 43

Page 40: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Design - Fun Loop

a flow of choices and feedback

page 40

Page 41: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Design - Fun Loop

Pac-Man

Page 42: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Design - Fun Loop

put in quarter

avoid ghosts

eat pellets

eat power pellet

chase ghost

clear maze

Pac-Man

Page 43: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Design - How it’s related to Comics

Narrative Flow, Narrative context

page 43

Page 44: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Design - How it’s related to Comics

Page 45: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision!2 different topics!

chooseA Bwhat is a game

heartbeat

Explore game files in the workshop

!

jump to page 46 jump to page 51

Page 46: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Heartbeat

page 46

Page 47: Underwater Tomato Ninja - HTML5 Game Development & Design

Frame Rateper second...

Page 48: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision! Mess With Game Timing

chooseA Bmake it faster

make it slower

!

jump to page 49 jump to page 50

Page 49: Underwater Tomato Ninja - HTML5 Game Development & Design

Make It Faster

boo!

whee!

page 49

Page 50: Underwater Tomato Ninja - HTML5 Game Development & Design

Make It Slower

aw!

page 50

Page 51: Underwater Tomato Ninja - HTML5 Game Development & Design

The Files You Have - You do Have Them, Right?

page 51

Need the files? https://github.com/robstenzinger/HTML5-Game-Dev-Workshop

Page 52: Underwater Tomato Ninja - HTML5 Game Development & Design

How Do They Get Into the Game?

Page 53: Underwater Tomato Ninja - HTML5 Game Development & Design

let’s use the Elements tab to explore the page

Use the Browser Developer Tools to Find Something on Screen, Then

in Code

Page 54: Underwater Tomato Ninja - HTML5 Game Development & Design

Find by Searching the Code

Text editors give us tools like FIND, LINE

NUMBERS, and CODE HIGHLIGHTING to make

our job easier!

Page 55: Underwater Tomato Ninja - HTML5 Game Development & Design

Let's Change an Asset

art - sound - text

a chance to add

kitties or stars!

let’s change the game!

page 55

Page 56: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision! What kind of Asset to change?!

choose

A Bart sound

cText

!

Need the files? https://github.com/robstenzinger/HTML5-Game-Dev-Workshop

jump to page 57 jump to page 65jump to page 62

Page 57: Underwater Tomato Ninja - HTML5 Game Development & Design

Since we’re scripting so much for the game, let’s

use JavaScript...

ArtWeb browsers let us

load images in HTML, JavaScript, and CSS!

page 57

Page 58: Underwater Tomato Ninja - HTML5 Game Development & Design

Art Text

Page 59: Underwater Tomato Ninja - HTML5 Game Development & Design

Backgrounds

Page 60: Underwater Tomato Ninja - HTML5 Game Development & Design

Actors

Page 61: Underwater Tomato Ninja - HTML5 Game Development & Design

Objects

Page 62: Underwater Tomato Ninja - HTML5 Game Development & Design

sound effects

let’s look at how we LOAD and PLAY the

sounds!

BACKGROUND MUSIC

page 62

Page 63: Underwater Tomato Ninja - HTML5 Game Development & Design

sound effects

let’s look at how we LOAD and PLAY the

sounds!

JUMP SOUND

Page 64: Underwater Tomato Ninja - HTML5 Game Development & Design

sound effects

let’s look at how we LOAD and PLAY the

sounds!

COLLISION SOUND

Page 65: Underwater Tomato Ninja - HTML5 Game Development & Design

Text

lots of text in the game already...

or add some more!

page 65

Page 66: Underwater Tomato Ninja - HTML5 Game Development & Design

Decision!2 different topics!

chooseA Banimation game loop

!

jump to page 77 jump to page 67

Page 67: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Looptick update > run rules > update display > get input >

REPEAT!

page 67

Page 68: Underwater Tomato Ninja - HTML5 Game Development & Design

Flowstart screen > level start > play level ( > sections

within a level) > level complete > REPEAT!

Page 69: Underwater Tomato Ninja - HTML5 Game Development & Design

Parts

Score

how far to move

show the updates

to the score

which way to move?

how far to move?

when to jump at the

ninja?

where is the player

telling me to move?

am I colliding w/tomato?

if so did I squish it?input

jump! move left,

move right!

Page 70: Underwater Tomato Ninja - HTML5 Game Development & Design

Synchronized, Working Together

heatbeat + game loop

Score

input

Page 71: Underwater Tomato Ninja - HTML5 Game Development & Design

Looking at the Code and the Game

the game loop! instructions to update all the

parts of the game

the heartbeat! aka “tick”

Page 72: Underwater Tomato Ninja - HTML5 Game Development & Design

Decision!2 different topics!

chooseA Bgame art, text,

and soundmore detail about

the game loop

!

jump to page 55 jump to page 73

Page 73: Underwater Tomato Ninja - HTML5 Game Development & Design

Game Loop 2

2page 73

Page 74: Underwater Tomato Ninja - HTML5 Game Development & Design

Input

input

keyboard mouse

touch screen and more...

Page 75: Underwater Tomato Ninja - HTML5 Game Development & Design

Baddies - Computer Opponents

Page 76: Underwater Tomato Ninja - HTML5 Game Development & Design

Decision!2 different topics!

chooseA Bgame art, text,

and sound animation

!

jump to page 55 jump to page 77

Page 77: Underwater Tomato Ninja - HTML5 Game Development & Design

Animation

page 77

Page 78: Underwater Tomato Ninja - HTML5 Game Development & Design

Coordinate Systemx

y

00 20

20

7,5

7

5

we use coordinates X and Y to position game

objects!

Page 79: Underwater Tomato Ninja - HTML5 Game Development & Design

CSS3 Transformslet’s check out the code example css-transform-

playground.html

each tick of the game

heartbeat, we use css3

transforms to update

anything we want to move!

Page 80: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision!game + workshop to make a game

chooseA Bparallax

backgroundscharacter

movement + hop

!

jump to page 81 jump to page 82

Page 81: Underwater Tomato Ninja - HTML5 Game Development & Design

Background Parallax

scrolling speed B

scrolling speed ACloser = Faster

page 81

Page 82: Underwater Tomato Ninja - HTML5 Game Development & Design

Character Movement - Hop

page 82

Page 83: Underwater Tomato Ninja - HTML5 Game Development & Design

time for a bonus level?

chooseA B

no time!animation breathing

c danimation

wobbleanimation particles

!

jump to page 85 jump to page 87

jump to page 88 jump to page 86

Page 84: Underwater Tomato Ninja - HTML5 Game Development & Design

Animation Bonus Levels

Page 85: Underwater Tomato Ninja - HTML5 Game Development & Design

wobble

page 85

Page 86: Underwater Tomato Ninja - HTML5 Game Development & Design

breathe

page 86

Page 87: Underwater Tomato Ninja - HTML5 Game Development & Design

particles!

page 87

Page 88: Underwater Tomato Ninja - HTML5 Game Development & Design

JUST ME.

• Game Testers Robot Experiment - gone wrong

Boss Fight!!

page 88

Page 89: Underwater Tomato Ninja - HTML5 Game Development & Design

Boss Fight!JUST ME. AND A FEW

FRIENDS HERE TO

TAKE - I MEAN TEST YOUR GAME!

• Defeat the Robot Army by Calling Out Accomplishments

Page 90: Underwater Tomato Ninja - HTML5 Game Development & Design

Victory!game lab time!

bzzzt... all my base are belong

to you

Page 91: Underwater Tomato Ninja - HTML5 Game Development & Design

Time to Craft

what are you doing up there?

ha-haarrrrrr!

Page 92: Underwater Tomato Ninja - HTML5 Game Development & Design

Discussion

easier?more difficult!

arrrrrrrr!surprising...

Page 93: Underwater Tomato Ninja - HTML5 Game Development & Design

Demos

Page 94: Underwater Tomato Ninja - HTML5 Game Development & Design
Page 95: Underwater Tomato Ninja - HTML5 Game Development & Design

More Discussion OnlineOn a Posterous Private Forum for This Kids Read comics Class

I’ll check-in, comment, and respond on the

11th, 13th, and 14th of July 2012! Parental

permission form required!

Share your games and

questions!

http://megamega-krc2012.posterous.com/

Page 96: Underwater Tomato Ninja - HTML5 Game Development & Design

More Resources• Workshop source code files and assets

• https://github.com/robstenzinger/HTML5-Game-Dev-Workshop

• Lean Into Art

• Theory of Fun

• html5rocks.Com

• lostdecadegames.com

• interactive-storyteller.com

• History of Video Games

Page 97: Underwater Tomato Ninja - HTML5 Game Development & Design

congratulations!

High Score Board & Custom URL

The version of the game we customized together will be downloadable from http://agz.me/krc2012/gameworkshop

to get your score on the high-score boardenter 3 initials/letters + your score on the paper high-score board!

I’ll add them to the game before I post it!

Page 98: Underwater Tomato Ninja - HTML5 Game Development & Design

Continue?

9... 8... 7...6

5... 4... 3...

Page 99: Underwater Tomato Ninja - HTML5 Game Development & Design

Future• HTML5 on Your TV

• Google TV

• XBox

• Playstation 3

• Wii

• Full Screen API

• Game Controller API

much of this is here already or coming very soon!

Page 100: Underwater Tomato Ninja - HTML5 Game Development & Design

--> Decision! bonus unlock

chooseA Bsee a screen

from the first game rob made*

hear about the first release of guitar fretter

jump to page 102 jump to page 101

Page 101: Underwater Tomato Ninja - HTML5 Game Development & Design

Bonus - Guitar Fretter Lessons Learned

page 101

Page 102: Underwater Tomato Ninja - HTML5 Game Development & Design

Bonus - Screenshot of Rob’s 1st Game

page 102

Page 103: Underwater Tomato Ninja - HTML5 Game Development & Design

Thank You For Playing!