Added a Sample Plugin and tested out the Plugin Manager. Working great :)

This commit is contained in:
Richard Davey
2013-09-11 17:32:53 +01:00
parent fba731e740
commit 95374339b9
8 changed files with 631 additions and 891 deletions
+44
View File
@@ -0,0 +1,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>