lenlac Posted December 28, 2014 Share Posted December 28, 2014 Ok so i am exploring another option so far I gotfunction collideEnemy (player, baddie) { if( baddie.touching.up ) { //Call a jump function or something here... player.body.velocity.y = -200; //Maybe put the enemy into a different group so it doesn't collide with the player anymore... baddie.kill(); } else { //You would probably want something a little more than this... player.kill(); }}which i found in the forum. however the part: if( baddie.touching.up ) is freezing the game. i am sure its syntax somehow. Could anyone help with the proper way to call this function with Phaser 2.2? for fun I tested if( 1 < 2 ) and tested to see if it would work and it does. Could anyone else help with this? thanks. Link to comment Share on other sites More sharing options...
lenlac Posted December 29, 2014 Author Share Posted December 29, 2014 well i found this solution and implemented it.player.body.y + player.body.height < enemie.body.y + 20I would still like to be able to use the phaser api touching.up if anyone has any advice. ty the update function changed to : game.physics.arcade.overlap(player, baddie); EDIT # 3 OH LORD after hours of stupidity. The baddie.body.touching.up as an If statement works when when you use the overlap instead of collide! i am exhausted.lol Link to comment Share on other sites More sharing options...
Recommended Posts