mirror of
https://github.com/wassname/phaser.git
synced 2026-06-27 16:10:15 +08:00
35 lines
545 B
HTML
35 lines
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> |