Jump to content

What´s the best way to let your character to jump through platforms?


totallybueno
 Share

Recommended Posts

Hi,

I have this basic platform game and I would like the hero to jump through the platforms, from underneath to the top of the platform, but I´m not being able to do that and the head of the hero collides with the bottom of the platform even when I set the collideDown of that tile (actually, to all the tiles of that layer) to false.

What am I missing?

 

this.platformsLayer = this.map.createLayer("platforms")
this.map.setCollisionBetween(1,50, true, "platforms")

var tilesArray = this.platformsLayer.getTiles(0,0,this.game.world.width, this.game.world.height)
for(var i=0;i<tilesArray.length;i++){
	tilesArray[i].collideDown=false
	tilesArray[i].setCollision(true, true, true, false)
	console.log("All set to false")
}

 

Link to comment
Share on other sites

41 minutes ago, totallybueno said:

I still don´t get why


tilesArray[i].collideDown=false

is not working as I was expecting.

Had a quick look at the source (collideSpriteVsTilemapLayer), it (collideDown etc) doesn't look implemented?
I guess you could just set the collide processCallback, and return false...

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...