mirror of
https://github.com/wassname/phaser.git
synced 2026-08-19 12:30:07 +08:00
The start of World, also moved Game/Stage into core.
This commit is contained in:
+10
-9
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user