Jump to content

Problem with atlas/multiatlas


koruvika
 Share

Recommended Posts

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!!

 

 

 

 

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...