mirror of
https://github.com/wassname/phaser.git
synced 2026-06-27 16:10:15 +08:00
Merging previous changes back in again.
This commit is contained in:
@@ -3,8 +3,8 @@ var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: p
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.tilemap('level3', 'assets/maps/cybernoid.json', null, Phaser.Tilemap.TILED_JSON);
|
||||
game.load.image('tiles', 'assets/maps/cybernoid.png', 16, 16);
|
||||
game.load.tilemap('level3', 'assets/tilemaps/maps/cybernoid.json', null, Phaser.Tilemap.TILED_JSON);
|
||||
game.load.image('tiles', 'assets/tilemaps/tiles/cybernoid.png', 16, 16);
|
||||
game.load.image('phaser', 'assets/sprites/phaser-ship.png');
|
||||
game.load.image('chunk', 'assets/sprites/chunk.png');
|
||||
|
||||
@@ -29,13 +29,12 @@ function create() {
|
||||
// Basically this sets EVERY SINGLE tile to fully collide on all faces
|
||||
map.setCollisionByExclusion([7, 32, 35, 36, 47]);
|
||||
|
||||
// layer.debug = true;
|
||||
layer.debug = true;
|
||||
|
||||
layer.resizeWorld();
|
||||
|
||||
sprite = game.add.sprite(450, 80, 'phaser');
|
||||
sprite.anchor.setTo(0.5, 0.5);
|
||||
sprite.angle = 5;
|
||||
|
||||
game.camera.follow(sprite);
|
||||
// game.camera.deadzone = new Phaser.Rectangle(160, 160, layer.renderWidth-320, layer.renderHeight-320);
|
||||
@@ -47,7 +46,7 @@ function create() {
|
||||
emitter.makeParticles('chunk');
|
||||
emitter.minRotation = 0;
|
||||
emitter.maxRotation = 0;
|
||||
emitter.gravity = 5;
|
||||
emitter.gravity = 150;
|
||||
emitter.bounce.setTo(0.5, 0.5);
|
||||
|
||||
game.input.onDown.add(particleBurst, this);
|
||||
|
||||
+12
-12
@@ -28,7 +28,7 @@ function create() {
|
||||
var bg = game.add.sprite(0, 0, bmd);
|
||||
bg.body.moves = false;
|
||||
|
||||
test7();
|
||||
test4();
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ function test7() {
|
||||
|
||||
game.physics.gravity.y = 200;
|
||||
|
||||
sprite = game.add.sprite(300, 300, 'gameboy', 0);
|
||||
sprite = game.add.sprite(0, 300, 'gameboy', 0);
|
||||
sprite.name = 'red';
|
||||
sprite.body.collideWorldBounds = true;
|
||||
sprite.body.bounce.setTo(0.8, 0.8);
|
||||
@@ -119,7 +119,7 @@ function stop5() {
|
||||
|
||||
function test4() {
|
||||
|
||||
game.physics.gravity.y = 50;
|
||||
game.physics.gravity.y = 150;
|
||||
|
||||
sprite = game.add.sprite(300, 0, 'gameboy', 0);
|
||||
sprite.name = 'red';
|
||||
@@ -242,15 +242,15 @@ function update() {
|
||||
|
||||
// game.physics.collide(group, group);
|
||||
|
||||
// if (sprite3)
|
||||
// {
|
||||
// game.physics.collideArray(sprite, [sprite2, sprite3]);
|
||||
// game.physics.collide(sprite2, sprite3);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// game.physics.collide(sprite, sprite2);
|
||||
// }
|
||||
if (sprite3)
|
||||
{
|
||||
game.physics.collideArray(sprite, [sprite2, sprite3]);
|
||||
game.physics.collide(sprite2, sprite3);
|
||||
}
|
||||
else
|
||||
{
|
||||
game.physics.collide(sprite, sprite2);
|
||||
}
|
||||
|
||||
|
||||
if (sprite)
|
||||
|
||||
@@ -23,10 +23,11 @@ function create() {
|
||||
bg.body.moves = false;
|
||||
|
||||
game.physics.gravity.y = 250;
|
||||
// game.physics.gravity.x = 250;
|
||||
|
||||
sprites = game.add.group();
|
||||
|
||||
for (var i = 0; i < 40; i++)
|
||||
for (var i = 0; i < 20; i++)
|
||||
{
|
||||
var s = sprites.create(game.rnd.integerInRange(100, 700), game.rnd.integerInRange(32, 200), 'ball');
|
||||
s.body.velocity.x = game.rnd.integerInRange(-400, 400);
|
||||
|
||||
@@ -3,8 +3,8 @@ var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: p
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.tilemap('level3', 'assets/maps/cybernoid.json', null, Phaser.Tilemap.TILED_JSON);
|
||||
game.load.image('tiles', 'assets/maps/cybernoid.png', 16, 16);
|
||||
game.load.tilemap('level3', 'assets/tilemaps/maps/cybernoid.json', null, Phaser.Tilemap.TILED_JSON);
|
||||
game.load.image('tiles', 'assets/tilemaps/tiles/cybernoid.png', 16, 16);
|
||||
game.load.image('phaser', 'assets/sprites/phaser-ship.png');
|
||||
game.load.image('chunk', 'assets/sprites/chunk.png');
|
||||
|
||||
@@ -29,7 +29,7 @@ function create() {
|
||||
// Basically this sets EVERY SINGLE tile to fully collide on all faces
|
||||
map.setCollisionByExclusion([7, 32, 35, 36, 47]);
|
||||
|
||||
// layer.debug = true;
|
||||
layer.debug = true;
|
||||
|
||||
layer.resizeWorld();
|
||||
|
||||
@@ -47,7 +47,7 @@ function create() {
|
||||
emitter.makeParticles('chunk');
|
||||
emitter.minRotation = 0;
|
||||
emitter.maxRotation = 0;
|
||||
emitter.gravity = 5;
|
||||
emitter.gravity = 150;
|
||||
emitter.bounce.setTo(0.5, 0.5);
|
||||
|
||||
game.input.onDown.add(particleBurst, this);
|
||||
|
||||
Reference in New Issue
Block a user