Chrome Game programming (with ForPlay) Firenze GTUG, 06.07.2011 Luca Masini
Agenda ■ Anatomy of a 2D Arcade ■ Impact HTML5 Game Library ■ ForPlay: features ■ Hand-on a simple demo
Anatomy of a 2D ArcadeGame LifecycleWe can identify three steps: ● init: asset loading and general housekeeping ● update: game logic and physics ● paint: everything that is strictly inherent to graphics
Anatomy of a 2D ArcadeAsset 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.
Anatomy of a 2D ArcadeI/O Subsystems ● Input from joypad, touchscreen, keyboard, pointer ● Disk Storage and network ● Audio Device ● Video Device
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
First ForPlay project in 30sUsing a maven-archetype:mvn -DarchetypeRepository= http://forplay.googlecode.com/svn/mavenrepo-DarchetypeGroupId=forplay-DarchetypeArtifactId=forplay-sample-archetype-DarchetypeVersion=1.0archetype:generate
...forplay is not limited to HTML, these are the generatedplatforms: ● HTML5 ● Android ● Java Desktop ● Flash