Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Phaser HTML5 Game Framework @ Otomat Hackaton
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Eralp Karaduman
November 19, 2016
Programming
0
160
Phaser HTML5 Game Framework @ Otomat Hackaton
Slides from the lightning talk I gave, at awesome
http://otomat.org
hackaton.
Eralp Karaduman
November 19, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
今から始めるClaude Code超入門
448jp
7
8.3k
Implementation Patterns
denyspoltorak
0
280
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
AI時代の認知負荷との向き合い方
optfit
0
140
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.3k
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
Featured
See All Featured
Between Models and Reality
mayunak
1
180
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
230
Designing for Performance
lara
610
70k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
[SF Ruby Conf 2025] Rails X
palkan
0
740
Navigating Team Friction
lara
192
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
130
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
62
Transcript
PHASER HTML5 GAME FRAMEWORK
ERALP KARADUMAN SUPER DAMAGE GAMES
None
None
None
None
None
None
GLOBAL GAME JAM LUDUM DARE ITCH.IO
None
GAME FRAMEWORK?
RENDERING SCALING PARTICLES
TILEMAPS TIMERS TWEENS
ANIMATION SPRITES INPUT TEXT
PHYSICS AUDIO CANVAS / WEBGL
None
INDEX.HTML <!doctype html> <html> <head> <meta charset="UTF-8" /> <title>try-phaser</title> <link
rel="stylesheet" href="/main.css" media="all"> </head> <body> <div id="content"></div> <script src="/bin/phaser.min.js"></script> <script src="/bin/bundle.js"></script> </body> </html>
MAIN.JS new Phaser.Game(800, 600, Phaser.AUTO, 'content', null);
MAIN.JS var bootState = require("./bootState"); var game = new Phaser.Game(800,
600, Phaser.AUTO, 'content', null); game.state.add('boot', bootState); game.state.start('boot');
MAIN.JS var bootState = require("./bootState"); var loadState = require("./loadState"); var
introState = require("./introState"); var gameState = require("./gameState"); var game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', null); game.state.add('boot', bootState); game.state.add('load', loadState); game.state.add('intro', introState); game.state.add('game', gameState); game.state.start('boot');
BOOTSTATE.JS module.exports = { preload: function() { // load assets
} create: function() { // setup game // initiate player // initiate enemy game.state.start('load'); } update: function() { // handle input & move sprites & check collisions } }
INTROSTATE.JS module.exports = { create: function() { var logo =
this.add.sprite( this.world.centerX, this.world.centerY, 'logo' ); logo.anchor.setTo(0.5, 0.8); var button = this.add.button(this.world.centerX, 500, 'btn', function() { game.state.start('game'); }, this, 1, 0, 0); button.anchor.setTo(0.5, 0.5); } }
None
LOADSTATE.JS module.exports = { preload: function() { this.load.image('logo', 'phaser.png'); this.load.image('man-blue',
'man-blue.png'); this.load.image('man-red', 'man-red.png'); this.load.image('logo', 'phaser.png'); this.load.spritesheet('btn', 'btn-spritesheet.png', 288, 84); }, create: function() { this.state.start('intro'); } }
this.load.spritesheet( 'btn', 'btn-spritesheet.png', 288, 84 );
GAMESTATE.JS var Person = require('./person'); var input = {}; var
player = null function create() { var game = window.game; player = new Person(game, this.world.centerX, this.world.centerY); input.upKey = game.input.keyboard.addKey(Phaser.Keyboard.UP); input.downKey = game.input.keyboard.addKey(Phaser.Keyboard.DOWN); input.leftKey = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); input.rightKey = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); } function update() { input.up = input.upKey.isDown; input.down = input.downKey.isDown; input.left = input.leftKey.isDown; input.right = input.rightKey.isDown; player.move(input); } module.exports = { create: create, update, update }
GAMESTATE.JS (CREATE) var input = {}; var player = null
function create() { var game = window.game; player = new Person(game, this.world.centerX, this.world.centerY); input.upKey = game.input.keyboard.addKey(Phaser.Keyboard.UP); input.downKey = game.input.keyboard.addKey(Phaser.Keyboard.DOWN); input.leftKey = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); input.rightKey = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); }
GAMESTATE.JS (UPDATE) function update() { input.up = input.upKey.isDown; input.down =
input.downKey.isDown; input.left = input.leftKey.isDown; input.right = input.rightKey.isDown; player.move(input); }
PERSON.JS var Person = function(game, x, y) { this.moveSpeed =
5; Phaser.Sprite.call(this, game, x, y, 'man-blue'); this.anchor.setTo(0.5, 0.5); game.add.existing(this); } Person.prototype = Object.create(Phaser.Sprite.prototype); Person.prototype.constructor = Person; Person.prototype.update = function() { } Person.prototype.move = function(input) { // ... } module.exports = Person
PERSON.JS (MOVE) Person.prototype.move = function(input) { var pos = {y:
0, x: 0}; if (input.up) { pos.y = -1; } else if (input.down) { pos.y = 1; } if (input.left) { pos.x = -1; } else if (input.right) { pos.x = 1; } this.x += (pos.x * this.moveSpeed); this.y += (pos.y * this.moveSpeed); }
phaser.org ludumdare.com/compo/ itch.io/jams globalgamejam.org @superdamage superdamage.com eralpkaraduman.com @eralpkaraduman