phaser/v2/resources/tutorials/01 Getting Started/hellophaser/index.html
2016-11-23 00:17:46 +00:00

38 lines
No EOL
1,008 B
HTML
Executable file

<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>hello phaser!</title>
<script src="//cdn.jsdelivr.net/phaser/2.5.0/phaser.min.js"></script>
</head>
<body>
<script type="text/javascript">
window.onload = function() {
// Note that this html file is set to pull down Phaser 2.5.0 from the JS Delivr CDN.
// Although it will work fine with this tutorial, it's almost certainly not the most current version.
// Be sure to replace it with an updated version before you start experimenting with adding your own code.
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
function preload () {
game.load.image('logo', 'phaser.png');
}
function create () {
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo');
logo.anchor.setTo(0.5, 0.5);
}
};
</script>
</body>
</html>