12
Chrome Game programming (with ForPlay) Firenze GTUG, 06.07.2011 Luca Masini

Chrome game programming_with_for_play

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Chrome game programming_with_for_play

Chrome Game programming (with ForPlay)

Firenze GTUG, 06.07.2011Luca Masini

Page 2: Chrome game programming_with_for_play

Agenda

■ Anatomy of a 2D Arcade

■ Impact HTML5 Game Library

■ ForPlay: features■ Hand-on a simple demo

Page 3: Chrome game programming_with_for_play

Anatomy of a 2D Arcade

Game Lifecycle

We can identify three steps:

● init: asset loading and general housekeeping

● update: game logic and physics

● paint: everything that is strictly inherent to graphics

Page 4: Chrome game programming_with_for_play

Anatomy of a 2D Arcade

Asset Management

● We need to load Images, Sounds, Text before they are used, but in a smart way so that the memory is not filled from the start.

● We also need a callback mechanism that warns us when a particular asset is loaded.

Page 5: Chrome game programming_with_for_play

Anatomy of a 2D Arcade

I/O Subsystems

● Input from joypad, touchscreen, keyboard, pointer

● Disk Storage and network

● Audio Device

● Video Device

Page 6: Chrome game programming_with_for_play

Impact HTML5 Game Library

● Impact has a visual game editor for level and AI scripting

● It really uses CANVAS and AUDIO tags● Target at classic 2D games, using many ideas from

old consoles (like Super Nintendo)● Sprites are drawn over multiple background layers

(for parallax) made up of many bricks of smaller images

Page 7: Chrome game programming_with_for_play

Impact: Weltmeister Game Editor

Page 8: Chrome game programming_with_for_play

First ForPlay project in 30s

Using a maven-archetype:

mvn -DarchetypeRepository= http://forplay.googlecode.com/svn/mavenrepo -DarchetypeGroupId=forplay -DarchetypeArtifactId=forplay-sample-archetype -DarchetypeVersion=1.0 archetype:generate

Page 9: Chrome game programming_with_for_play
Page 10: Chrome game programming_with_for_play
Page 11: Chrome game programming_with_for_play

...forplay is not limited to HTML, these are the generated platforms:

● HTML5● Android● Java Desktop● Flash

Page 12: Chrome game programming_with_for_play

Riferimenti

● Impact official site: http://impactjs.com/● Impact article on Google Code Blog: http:

//googlecode.blogspot.com/2011/05/creating-2d-games-with-javascript-html5.html

● forplay official site: http://code.google.com/p/forplay/

● Kick-ass Game Programming with GWT (Google I/O 2011): http://www.google.com/events/io/2011/sessions/kick-ass-game-programming-with-google-web-toolkit.html