1 decade ago by Donzo
Hi.
I had two issues with the pass through tiles about which I was wondering:
1. I'm using the same bounce detection code that came with Jumpnrun -
but I'm also using lots of one-way tiles.
The problem is that the projectiles don't seem to recognize collisions on the one-way tiles using res.collision.x
If the player is shooting a lot, the level becomes polluted with these trapped projectiles that eventually consume all of the resources.
Is there a way to tweak res.collision.x or add some property or something that would recognize collisions with the one way tiles? How could I do this?
2. One-way tiles are fun, but sometimes the player knocks into them and it makes the jumping experience less than smooth. Rather than having entities only pass through one-way, is there a way to tweak it so that they only collide one-way? In other words, can they pass though the tiles moving three directions (forward, backward, and upward for instance) and only collide with one side of the surface?
I had two issues with the pass through tiles about which I was wondering:
1. I'm using the same bounce detection code that came with Jumpnrun -
handleMovementTrace: function( res ) {
this.parent( res );
if( res.collision.x || res.collision.y ) {
// only bounce 3 times
this.bounceCounter++;
if( this.bounceCounter > 2 ) {
this.kill();
}
}
},
but I'm also using lots of one-way tiles.
The problem is that the projectiles don't seem to recognize collisions on the one-way tiles using res.collision.x
If the player is shooting a lot, the level becomes polluted with these trapped projectiles that eventually consume all of the resources.
Is there a way to tweak res.collision.x or add some property or something that would recognize collisions with the one way tiles? How could I do this?
2. One-way tiles are fun, but sometimes the player knocks into them and it makes the jumping experience less than smooth. Rather than having entities only pass through one-way, is there a way to tweak it so that they only collide one-way? In other words, can they pass though the tiles moving three directions (forward, backward, and upward for instance) and only collide with one side of the surface?
