Delete this account Posted February 25, 2018 Share Posted February 25, 2018 kjladsjksakjladsjkldajklsjadksllkjdsajaklsdkjsadlkjls Link to comment Share on other sites More sharing options...
samme Posted February 26, 2018 Share Posted February 26, 2018 (edited) map.createFromObjects("objects", 3, "ball", 0, true, false, undefined, Ball); this.ball = this.game.world.getTop(); I would remove the game.add.existing in the constructor, because createFromObjects is already inserting it in game.world. Edited February 27, 2018 by samme getTop() Delete this account 1 Link to comment Share on other sites More sharing options...
Delete this account Posted February 27, 2018 Author Share Posted February 27, 2018 ksdjksdljkjlksddfs Link to comment Share on other sites More sharing options...
samme Posted February 27, 2018 Share Posted February 27, 2018 Oops, that should be getTop. delete this account! 1 Link to comment Share on other sites More sharing options...
delete this account! Posted February 28, 2018 Share Posted February 28, 2018 On 27/02/2018 at 5:09 PM, samme said: Oops, that should be getTop. Cheers. I'm using Typescript and getTop returns any. How can I cast that to the ball script? this.game.world.getTop as Ball isn't working for me. Edit: I was a fool. It should be this.game.world.getTop() Link to comment Share on other sites More sharing options...
samme Posted February 28, 2018 Share Posted February 28, 2018 I guess it would be Phaser.Sprite then. Link to comment Share on other sites More sharing options...
Recommended Posts