Jump to content

Breno Pinheiro

Members
  • Content Count

    7
  • Joined

  • Last visited

  1. moeda.sprite.alive works if I use the phaser in a browser game, but If I use in a cordova app, an error is showed saying that the propriety don't exist.
  2. The P2 Physics don´t have a method called kill. If I use the moeda.destroy(), the body of the coin is destroyed, but the sprite keeps showed.
  3. Hello, I am trying to create a game, using P2 Physics, that the user can catch coins. The problem is that when the user catch a coin, I need to increment a variable. If I use a code like this astronauta.body.collides(moedaCollisionGroup, function (astronauta, moeda) { moeda.sprite.kill(); moedaspegas++; exit; }, this); The sprite of coin is hided, but the variable moedaspegas keeps being incremented. How can I do to the variable moedaspegas is incremented once?
  4. Hello, I studying how to create a game like 8 ball pool game. But when the ball collides on the world bounds, the bouncing effect dont work. GameStates.Game = function (game) { }; GameStates.Game.prototype = { create: function () { this.physics.startSystem(Phaser.Physics.ARCADE); this.stage.backgroundColor = '#124184'; forca_x_ini = 0; forca_y_ini = 0; forca_x_fim = 0; forca_y_fim = 0; forca_total_x = 0; forca_total_y = 0; line = null; bolas = this.add.group();
  5. Yes, I know. But in this case, I would like that tile "disappears" of the screen. Using, for example, tile.sprite.kill() don´t work because the tile dont have a sprite attached with itself.
  6. Hi, I am trying to create a platform game like Sonic using phaser, tilemap and physic. Using the examples that I found in Phaser official website, I can do the basic, like the hero walks and collides with the map. But I cant define the callbacks functions, like, for example, to get coins and died when the hero beats with a enemy. I would like a example how can I do this using the arcade and p2 physics class.
×
×
  • Create New...