nanu Posted November 7, 2016 Share Posted November 7, 2016 I'm an absolute beginner to Phaser and Javascript and I'm following the official tutorial on the website. I've been trying to learn how to use javascript as well as how to properly use the documentation. At this part in the tutorial it says: platforms = game.add.group(); var ground = platforms.create(0,game.world.height-64,'ground'); ground.scale.setTo(2,2); So to my understanding, in the first line I'm creating a 'platform' group using group() right? Could I have made a group without using game.add? Then I'm making a ground sprite (since create() returns Phaser.Sprite) using group.create(). But the third line confuses me. create() returns Phaser.Sprite but according to the docs there is no 'scale' property in Sprite. How am I able to access 'scale'? Could someone explain this to me? I may be reading this whole thing wrong or missing something small. Link to comment Share on other sites More sharing options...
samme Posted November 7, 2016 Share Posted November 7, 2016 I'd noticed the missing `scale` too, that's a mistake. Phaser.Sprite has a `scale` from http://phaser.io/docs/2.6.2/PIXI.PIXI.DisplayObject.html#scale. You can make a group with any of game.add.group(); game.make.group(); new Phaser.Group(game); nanu 1 Link to comment Share on other sites More sharing options...
Recommended Posts