Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Phaser HTML5 Game Framework @ Otomat Hackaton
Search
Eralp Karaduman
November 19, 2016
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Phaser HTML5 Game Framework @ Otomat Hackaton
Slides from the lightning talk I gave, at awesome
http://otomat.org
hackaton.
Eralp Karaduman
November 19, 2016
Other Decks in Programming
See All in Programming
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
R8 の設定見直しでアプリサイズ削減
andpad
0
220
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Railsバージョンを4倍にした話
optim
0
350
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
920
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Between Models and Reality
mayunak
4
500
Embracing the Ebb and Flow
colly
88
5.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
First, design no harm
axbom
PRO
2
1.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Designing for humans not robots
tammielis
254
26k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
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