flowabuse Posted January 20, 2015 Share Posted January 20, 2015 I'm having a bit of trouble trying to scale the body of my circle sprite using circleSprite.body.data.shapes[0] which I found in this thread http://www.html5gamedevs.com/topic/10094-cant-scale-sprite-body-using-tween/#entry59444 The sprite starts moving in a weird pattern across the screen. Here is a gif showing the movement: http://makeagif.com/i/SeqG8k I'm sorry if it's something obvious, I'm new to Phaser.class SimpleGame { constructor() { this.game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', { create: this.create, update: this.update , render: this.render }); } game: Phaser.Game; circleSprite: Phaser.Sprite; graphics: Phaser.Graphics; circle: PIXI.Graphics; create() { this.circleSprite = this.game.add.sprite(200,300); this.game.physics.startSystem(Phaser.Physics.P2JS); this.graphics = this.game.add.graphics(0, 0); this.graphics.lineStyle(4, 0xFF0000, 0.5); this.circle = this.graphics.drawCircle(0, 0, 50); this.graphics.endFill(); this.circleSprite.addChild(this.circle); this.game.physics.enable(this.circleSprite, Phaser.Physics.P2JS,true); this.circleSprite.body.setCircle(20); this.game.add.tween(this.circleSprite.body.data.shapes[0]).to({ radius: 90 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true); update() { } render() this.game.debug.inputInfo(50, 50)}window.onload = () => { var game = new SimpleGame();} Link to comment Share on other sites More sharing options...
flowabuse Posted January 24, 2015 Author Share Posted January 24, 2015 bump Link to comment Share on other sites More sharing options...
flowabuse Posted January 30, 2015 Author Share Posted January 30, 2015 bump Link to comment Share on other sites More sharing options...
flowabuse Posted February 2, 2015 Author Share Posted February 2, 2015 Wow, i thought linking Visual Studio to Chrome and refreshing linked browsers would save my changes that I made in my .ts file and update my .js file but it did't do that for me. So the code actualy worked but I've been failing to spot this. Link to comment Share on other sites More sharing options...
Recommended Posts