The start of World, also moved Game/Stage into core.

This commit is contained in:
Richard Davey
2013-08-29 21:57:36 +01:00
parent 6bf7bab917
commit 5b036557c0
5 changed files with 141 additions and 38 deletions
+10 -9
View File
@@ -42,19 +42,22 @@
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/pixi/utils/Utils.js"></script>
<script src="../src/core/StateManager.js"></script>
<script src="../src/core/State.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/core/StateManager.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Plugin.js"></script>
<script src="../src/core/PluginManager.js"></script>
<script src="../src/core/Stage.js"></script>
<script src="../src/core/World.js"></script>
<script src="../src/core/Game.js"></script>
<script src="../src/system/Canvas.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/core/PluginManager.js"></script>
<script src="../src/core/Plugin.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
@@ -67,5 +70,3 @@
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Stage.js"></script>
<script src="../src/Game.js"></script>
+9 -19
View File
@@ -12,37 +12,27 @@
(function () {
// var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update });
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }, false, true);
var bunny;
function preload() {
console.log('***> preload called');
game.load.image('cockpit', 'assets/pics/cockpit.png');
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
game.load.image('bunny', 'assets/sprites/bunny.png');
}
function create() {
console.log('***> create called');
// Create a basetexture
var base = new PIXI.BaseTexture(game.cache.getImage('overdose'));
var base = new PIXI.BaseTexture(game.cache.getImage('bunny'));
var texture = new PIXI.Texture(base);
bunny = new PIXI.Sprite(texture);
// center the sprites anchor point
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
// move the sprite t the center of the screen
bunny.position.x = 200;
bunny.position.y = 150;
bunny.position.x = game.world.centerX;
bunny.position.y = game.world.centerY;
game.stage._s.addChild(bunny);
game.world.add(bunny);
}
@@ -50,9 +40,9 @@
if (game.paused == false)
{
bunny.rotation += 0.1;
bunny.scale.x += 0.01;
bunny.scale.y += 0.01;
bunny.rotation += 0.01;
// bunny.scale.x += 0.01;
// bunny.scale.y += 0.01;
}
}