• Content Count

  • Joined

  • Last visited

  1. Nevermind, I figure it out. Collide 2 body you need velocity
  2. Hi guys, somebody can please tell me how collide, push sprite go, tileSprite too. Read examples, find some solutions but i dont know whats wrong with my code: function preload(){ game.load.image('block1', 'block1.png'); game.load.image('block2', 'block2.png'); } function create() { game.physics.startSystem(Phaser.Physics.ARCADE); game.stage.backgroundColor = '#ECF0DD'; block1 = game.add.sprite(500, 300, 'block1'); game.physics.arcade.enable(block1); block1.body.allowCollision = true; block2 = game.add.sprite(700, 300, 'block2'); game.physics.arcade.enable(block2); block2.body.allowCollision = true; } function update() { game.physics.arcade.collide(block1, block2); if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { block1.body.x += 5; } else if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { block1.body.x -= 5; } else if (game.input.keyboard.isDown(Phaser.Keyboard.UP)) { block1.body.y -= 5; } else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) { block1.body.y += 5; } } var game = new Phaser.Game(900, 500, Phaser.CANVAS, 'game', {preload:preload, create:create,update:update}); Its just go through, dont collide at all. Can you please tell me how to collide left, right side too?
  3. Nevermind, it's my stupid code, just figure it out now. Anybody need help like me read examples of valueerror here
  4. Hello guys. I'm newbie, I've just learned phaser for a few weeks. Starting new example and ran into a problem. I know you guys support multitouch with this: game.input.maxPointers = 1; // also set 0 & 2 But how can we hold Go Foward button, and click Jump button then player will jump forward. There any example for this? Or simply we cant do this for now because html5 havenot supported yet? Thanks, Sorry my bad English
  5. Why you use chrome for your project? I think all games use Phaser should run by Phonegap or Cocoonjs