Jump to content

Phaser Iso Plugin - collisions/touching/sticking


Recommended Posts

I'm just trying out a further test with @lewster32's iso plug-in.

I was experimenting with making fixed tiles (well cubes), if you try this demo:


and add

cube.body.moves = false

then update and jump on any of the blocks, you see the effect: the player cube sinks...


Have I tried to make a solid cube the wrong way? Or, is something funny happening in the plug-in?

Link to comment
Share on other sites

body.immovable = true is the correct one to use and seems to work fine for me, though I think there may be a raft of issues related to incorrect separation on the z axis that I currently don't have time to fix. I may be able to look at it this week and put out a new bugfix release... fingers crossed!

Link to comment
Share on other sites

Ah - yes, I was getting mixed up between your demo, and mine...

body.immovable = true;

does work, but as per my previous issue this then affects the jumping as body.touching never changes (so sitting on top of an immovable cube is body.touching.none = true!!)



Further experimentation shows that touching does get set to true (at least initially) but for some reason the bodies are stuck together - manually moving the jumping body a couple of pixels enables the jump.




And the sticking isn't limited to z axis...


Link to comment
Share on other sites

Hi, I had the same problem.......

checking different post on this forum, maybe I've found a solution (it works for me):


        game.physics.isoArcade.collide(obstacleGroup, null, function(a, b) {

            if ((a === player)) {
                b.body.moves = false;

            if ((b === player)) {
                a.body.moves = false;

try it, maybe it works also for you.


Link to comment
Share on other sites

I didn't set it as you did, in the collision check, but added it the creation:

cube.body.moves = false;
cube.body.immovable = true;

- this doesn't resolve the sticking to the top edge - but I've adjusted my jump code to:

player.body.z += 2;
player.body.velocity.z = 250;

which "unsticks" it...

so, all in all, I've got something working, it just feels a little 'hacky'.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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