queequeg Posted March 18, 2017 Share Posted March 18, 2017 I've been having difficulty figuring out how to interact with my sprites from the chrome dev console. Is there a standard way to do that? Lets say that you add a sprite initGraphics: function () { this.shipSprite = game.add.sprite(shipProperties.startX, shipProperties.startY, graphicAssets.ship.name); this.shipSprite.angle = -90; this.shipSprite.anchor.set(0.5, 0.5); }, I can see my sprite and make it move around but when I bring up chrome console I can't seem to figure out how to directly access it's x and y properties. Link to comment Share on other sites More sharing options...
queequeg Posted March 18, 2017 Author Share Posted March 18, 2017 I'm working through this tutorial: http://www.zekechan.net/asteroids-html5-game-tutorial-1/ Link to comment Share on other sites More sharing options...
squilibob Posted March 19, 2017 Share Posted March 19, 2017 window.game.world.children[x] where x is the sprite number. since it is the only sprite this would be window.game.world.children[0] Link to comment Share on other sites More sharing options...
queequeg Posted March 19, 2017 Author Share Posted March 19, 2017 Thanks squilibob Link to comment Share on other sites More sharing options...
Recommended Posts