AlexArroyoDuque Posted February 18, 2014 Share Posted February 18, 2014 Hi!I have a sprite scaled to a smaller size (0.5, 0.5). I want that when the player press the "down" the size change. What occurs to me is that changes the size but scaled back to (1, 1) Greetings! Link to comment Share on other sites More sharing options...
XekeDeath Posted February 18, 2014 Share Posted February 18, 2014 Without code and a better idea of what you are trying to achieve, I can't offer advice. Link to comment Share on other sites More sharing options...
AlexArroyoDuque Posted February 19, 2014 Author Share Posted February 19, 2014 Hi! this is my code: create: this.player = this.game.add.sprite(150, 150, 'player'); this.player.anchor.setTo(0.5, 0.5); this.player.body.gravity.y = 650; this.player.scale.setTo(0.7, 0.7); this.player.body.bounce.y = 0.1; this.player.body.collideWorldBounds = true; this.player.body.setPolygon(40, 20, 80, 20, 100, 170, 30, 175); //If I don't put this, the player is generated in position 0, 0 this.player.body.x = 150; this.player.body.y = 150; update: if (this.cursors.down.isDown && this.player.body.onFloor()) { console.log('down'); //change size } Link to comment Share on other sites More sharing options...
XekeDeath Posted February 20, 2014 Share Posted February 20, 2014 You don't have anything in your update to change the size? Link to comment Share on other sites More sharing options...
AlexArroyoDuque Posted February 20, 2014 Author Share Posted February 20, 2014 If I put something to resize happens what I mentioned earlier ... Hi!I have a sprite scaled to a smaller size (0.5, 0.5). I want that when the player press the "down" the size change. What occurs to me is that changes the size but scaled back to (1, 1) Greetings! For example I could put something like this: if (this.cursors.down.isDown && this.player.body.onFloor()) { console.log('down'); //change size this.player.body.setCircle(16); } Link to comment Share on other sites More sharing options...
AlexArroyoDuque Posted February 21, 2014 Author Share Posted February 21, 2014 any help about this? Link to comment Share on other sites More sharing options...
Recommended Posts