mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
40 lines
No EOL
789 B
HTML
40 lines
No EOL
789 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Phaser - Making your first game, part 3</title>
|
|
<script src="//cdn.jsdelivr.net/phaser/2.2.2/phaser.min.js"></script>
|
|
<style type="text/css">
|
|
body {
|
|
margin: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
|
|
|
|
function preload() {
|
|
|
|
game.load.image('sky', 'assets/sky.png');
|
|
game.load.image('ground', 'assets/platform.png');
|
|
game.load.image('star', 'assets/star.png');
|
|
game.load.spritesheet('dude', 'assets/dude.png', 32, 48);
|
|
|
|
}
|
|
|
|
function create() {
|
|
|
|
game.add.sprite(0, 0, 'star');
|
|
|
|
}
|
|
|
|
function update() {
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |