Jump to content

Phaser Iso Plugin - collisions/touching/sticking


charlie_says
 Share

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:

http://rotates.org/phaser/iso/examples/character.htm

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!!)

 

<edit>

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.

</edit>

 

<edit2>

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

</edit2>

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

 Share

  • Recently Browsing   0 members

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