TheGeekTechZone Posted November 12, 2015 Share Posted November 12, 2015 Hello I have been using the function bringToTop(); to set my sprites on top of others and it works well but when I use sendToBack(); moveUp(); or moveDown(); the game crashes I checked the phaser.js file to see if those functions where there and they are. What could the problem be? Quote Link to comment Share on other sites More sharing options...
ekeimaja Posted November 12, 2015 Share Posted November 12, 2015 It depends where you use them. Show your code please, so we can help you. Quote Link to comment Share on other sites More sharing options...
TheGeekTechZone Posted November 13, 2015 Author Share Posted November 13, 2015 It depends where you use them. Show your code please, so we can help you.I am using them on the create function, if those functions work the same as bringToTop(); it should work because Im replacing bringToTop(); for sendToBack(); and it crashes function create () { enemy = game.add.sprite(103, 425, 'enemy', 'idle.png');// 325enemy.name = 'enemy';game.physics.enable(enemy, Phaser.Physics.ARCADE);enemy.body.setSize(0,0);enemy.scale.setTo(4, 4.3);// scale sprite imageenemy.anchor.setTo(0.5, 0.9);// move sprite imageenemy.sendToBack();} Quote Link to comment Share on other sites More sharing options...
TheGeekTechZone Posted November 13, 2015 Author Share Posted November 13, 2015 found out the syntax error sorry, game.world.sendToBack(enemy); Quote Link to comment Share on other sites More sharing options...
ekeimaja Posted November 13, 2015 Share Posted November 13, 2015 Please mark this topic to answered Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.