forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamera4.php
56 lines (37 loc) · 1.08 KB
/
camera4.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
var mummy;
function preload() {
game.load.spritesheet('mummy', 'assets/sprites/metalslug_mummy37x45.png', 37, 45, 18);
}
function create() {
mummy = game.add.sprite(0, 300, 'mummy');
mummy.scale.setTo(2, 2);
mummy.animations.add('walk');
mummy.animations.play('walk', 50, true);
game.add.tween(mummy).to({ x: game.width - 100 }, 20000, Phaser.Easing.Linear.None, true);
}
function update() {
mummy.angle += 1;
}
function render() {
game.debug.renderRectangle(mummy.bounds, 'rgba(255,255,0,0.1)');
game.debug.renderPoint(mummy.topLeft, 'rgb(255,0,0)');
game.debug.renderPoint(mummy.topRight, 'rgb(0,255,0)');
game.debug.renderPoint(mummy.bottomLeft, 'rgb(0,0,255)');
game.debug.renderPoint(mummy.bottomRight, 'rgb(255,0,255)');
}
})();
</script>
</body>
</html>