mirror of
https://github.com/wassname/phaser.git
synced 2026-07-15 01:11:26 +08:00
Group now extends PIXI.DisplayObjectContainer, rather than owning a _container property, which makes life a whole lot easier re: nesting.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
|
||||
function dirToArray($dir) {
|
||||
|
||||
$ignore = array('.', '..', '_site', 'assets', 'states', 'book', 'filters');
|
||||
$ignore = array('.', '..', '_site', 'assets', 'states', 'book', 'filters', 'misc');
|
||||
$result = array();
|
||||
$root = scandir($dir);
|
||||
$dirs = array_diff($root, $ignore);
|
||||
|
||||
|
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 196 B |
@@ -0,0 +1,45 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.image('pic', 'assets/pics/backscroll.png');
|
||||
|
||||
}
|
||||
|
||||
var sprite;
|
||||
var sprite2;
|
||||
var g;
|
||||
|
||||
function create() {
|
||||
|
||||
sprite = game.add.sprite(0, 0, 'pic');
|
||||
|
||||
g = game.add.group();
|
||||
|
||||
g.create(0, 0, 'pic');
|
||||
|
||||
g.y = 200;
|
||||
g.rotation = 0.1;
|
||||
|
||||
// sprite2 = game.add.sprite(0, 300, 'pic');
|
||||
|
||||
game.input.onDown.add(tint, this);
|
||||
|
||||
}
|
||||
|
||||
function tint() {
|
||||
|
||||
sprite.tint = Math.random() * 0xFFFFFF;
|
||||
// sprite2.tint = Math.random() * 0xFFFFFF;
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user