mirror of
https://github.com/photonstorm/phaser
synced 2024-12-04 18:40:59 +00:00
35 lines
No EOL
545 B
HTML
35 lines
No EOL
545 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Creating a game in Phaser, part 1</title>
|
|
<script src="phaser.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="gameContainer"></div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
window.onload = function() {
|
|
|
|
var game = new Phaser.Game(1024, 768, Phaser.AUTO, 'gameContainer', { preload: preload, create: create });
|
|
|
|
function preload () {
|
|
|
|
game.load.image('background', 'images/picture.png');
|
|
|
|
}
|
|
|
|
function create () {
|
|
|
|
game.add.sprite(0, 0, 'background');
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |