forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin1.php
More file actions
44 lines (29 loc) · 881 Bytes
/
Copy pathplugin1.php
File metadata and controls
44 lines (29 loc) · 881 Bytes
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
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
<script src="../plugins/SamplePlugin.js"></script>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
var plugin;
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
function create() {
// Create our SamplePlugin.
// All the SamplePlugin does is move a sprite across the screen,
// but it shows how to structure a plugin and hook it into key functions
plugin = game.plugins.add(Phaser.Plugin.SamplePlugin);
var tempSprite = game.add.sprite(0, 200, 'atari1');
plugin.addSprite(tempSprite);
}
})();
</script>
</body>
</html>