vmars316 Posted January 30, 2016 Share Posted January 30, 2016 Hello & Thanks , Once I have killed a sprite , how can I make it visible again ? function collisionLies02 (obj1, obj2) { bullet.body.velocity.y = -500; bullet.kill(); lies02sprite.kill(); scoreLiess(); // lies02sprite.create(); // lies02sprite.image.visible = true; } Thanks Link to comment Share on other sites More sharing options...
icp Posted January 30, 2016 Share Posted January 30, 2016 lies02sprite.revive(); Read the docs: http://phaser.io/docs/2.4.4/index Link to comment Share on other sites More sharing options...
vmars316 Posted January 31, 2016 Author Share Posted January 31, 2016 Yes , http://phaser.io/docs/2.4.4/index is a great resource . The prob for a noob though is not knowing what word to look for . I finally got there by thinking : Lets see now , if .kill() operates on a sprite . Probably the opposite of kill will be a sprite method also . A look thru sprite methods , a promising one is 'reset' . So I used that . Which works fine . When would I use revive ? Thanks Link to comment Share on other sites More sharing options...
icp Posted February 2, 2016 Share Posted February 2, 2016 It depends on your needs, if you need to revive the sprite where he died last use revive(), else if you want to revive the sprite at a custom position with custom properties use reset(). vmars316 1 Link to comment Share on other sites More sharing options...
vmars316 Posted February 2, 2016 Author Share Posted February 2, 2016 On 1/31/2016 at 2:25 PM, vmars316 said: Yes , http://phaser.io/docs/2.4.4/index is a great resource . The prob for a noob though is not knowing what word to look for . I finally got there by thinking : Lets see now , if .kill() operates on a sprite . Probably the opposite of kill will be a sprite method also . A look thru sprite methods , a promising one is 'reset' . So I used that . Which works fine . When would I use revive ? Thanks Guess I'll answer my own Post: I just found out about the improved Phaser Docs here: http://phaser.io/learn/chains Great stuff ! Thanks Arian Fornaris (@boniatillo_com) Link to comment Share on other sites More sharing options...
Recommended Posts