Cress

Members
  • Content Count

    6
  • Joined

  • Last visited

About Cress

  • Rank
    Newbie

Profile Information

  • Gender
    Not Telling
  1. Yes, the overlapping solved everything!
  2. This is the code : createSpikes: function() { this.spikes = this.game.add.group(); this.spikes.enableBody = true; var result = this.findObjectsByType('spike', this.map, 'objectsLayer'); result.forEach(function(element){ this.createFromTiledObject(element, this.spikes); }, this); },I haven't understand your code very well anyway, can you explain it?
  3. Thanks guys but I get the error this.spikes.body is undefined even if enableBody is set to true
  4. Hi everybody, I'm making a sidescroller game and when the player hits a spike it dies and the game starts over. This is fine but the spike starts moving to the right if it's hit from the left and it starts moving downward if it's hit from above. I don't know why this happens! The spike moves if hit even without the playerDie function. This is the line for collision in the update function: this.game.physics.arcade.collide(this.player, this.spikes, this.playerDie, null, this);spikes is a group of all spikes. This is the playerDie function: playerDie: function(player, blockedLayer) { this.player.alive = false; this.player.body.velocity.x = 0; this.player.loadTexture('playerDead'); this.game.time.events.add(1500, this.gameOver, this); }And this is the gameOver function: gameOver: function() { this.game.state.start('Game'); }Any hints?
  5. Hi everybody, I followed a tutorial for a sidescroller game which uses a map made with tiles in a .json format. I decided to create a map of my own and it works but the stage isn't resized to fit all the screen like it did before (using EXACT_FIT). The map is stretched correctly horizontally but not vertically so that it appears like a stripe at the top of the screen. Any hints?
  6. Hi everybody, I followed a tutorial for a side scroller game and I tried it on two different android devices. It works but on my phone the background becomes white after like half a second of the game start, only the player sprite remains and goes on moving, while on browser and on the other device the background is fine. I noticed that if I set the player x velocity to 0 (thus not moving and all is still) the background has no problems. I'm using AUTO for the graphics, is it a matter? I tried WebGL but my phone doesn't support it. The background is on a layer of its own.