when everything's done and fire an event Draw things • Create a Canvas • Copy bits from loaded images onto Canvas at appropriate coordinates Animate things • How much time has elapsed since the last screen draw? • Which frame we should be on? • Copy that frame's image from my loaded asset to the canvas Check for collisions • Track the width, height, and position for each thing • Compare nearby things to each other and look for overlap Handle input • Keyboard events (just pressed? held down?) • Pointer events (tap? click? drag? multi-touch?) Manage states • Title screen (tap to start) • Gameplay (whee!) • Game over (your final score) Play sounds • Make a new WebAudioContext • Handle multiple sounds playing at once Our Plan Of Attack
2006 • Full-time on HTML5 games since 2012 • Richard Davey is lead dev (@photonstorm) • He was TD of Aardman Digital for 6 years • Phaser is what they use for all their games "[...] if you're saddled with a game framework that is maintained during someone's spare time or is on a slow release cycle, then it doesn't take long before things are very outdated." ! - Richard Davey (@photonstorm)
(like animation frames) without making separate network requests for each image. • One large atlas image composed of many smaller images • Metadata about each small image inside the atlas image • File name • Width / Height • X/Y Position inside the atlas image