koruvika Posted June 6, 2019 Share Posted June 6, 2019 Hello everybody I created a coin that spin like a mario-coin And i have done that with atlas This is preload function: this.load.atlas('coin', 'assets/animation/coin/spritesheet.png', 'assets/animation/coin/spritesheet.json'); and create function: var frameNames = this.anims.generateFrameNames('coin', { start: 1, end: 16, prefix: 'image ', suffix: '.png' }); this.anims.create({ key: 'rotate', frames: frameNames, frameRate: 32, repeat: -1 }); coin = this.physics.add.sprite(200, 400, 'coin', 'image 10.png'); coin.setScale(0.3); coin.anims.play('rotate'); and now, i want to create more coin, but i am stuck with problem, can people help me? Thank everyone!! Quote Link to comment Share on other sites More sharing options...
Killerblade Posted July 25, 2019 Share Posted July 25, 2019 You just have to create your own elements in a loop, and set the animation for them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.