Jump to content

dbseraph

Members
  • Posts

    3
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://amerizalde.github.io/html5gamedev/?mobile=1

Profile Information

  • Gender
    Not Telling

dbseraph's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. That is actually what I originally tried, following a phaser example. But as you can see in the image, body.touching.down is also reading false. It reads false consistently however. body.blocking down reads true in the game.debug output.
  2. I am trying to add a jump to my game, but for some reason the detection is not working. As you can see in the image, the debug.bodyInfo (in-game) shows the blocked.down bool is true. I have my jump key to dump the blocked object to console, and as shown it still says blocked.down is false. The blocked.down does show correctly in console when the sprite is at the very bottom of the screen, which is why the "JUMPING!" line fired once. The sprite landed on the platform above it, but wouldn't jump after that. The layer is a tilemap, set as so: this.bg = this.add.tilemap('level');this.bg.addTilesetImage('level_sheet', 'tiles');this.layer = this.bg.createLayer('layer_1');this.bg.setCollisionByExclusion([12], true, this.layer);This is the jump code: // jump if (this.input.keyboard.justPressed(jump)) { if (this.player.body.blocked.down) { this.player.body.velocity.y = -600; console.log("JUMPING!"); } console.log(this.player.body.blocked); }Any help is appreciated!
×
×
  • Create New...