Jump to content

Sprite of group doesn't show up


PeeJeeDR
 Share

Recommended Posts

Hi i'm very new to phaser and i have one problem.

I'm using a group (called platforms) to put my ground in it.
But when i'm creating the ground and i test the game, the ground isn't showing up.

var game 	= new Phaser.Game(1024, 512, Phaser.AUTO, '', { preload: preload, create: create, update: update });
var platforms;

function preload() {
     game.load.image('platform', 'assets/platform.png');
}

function create() {

	/* === GROUPS === */
	// PLATFORMS
	platforms = game.add.group();

	// PHYSICS
	platforms.enableBody = true;



    /* === GROUND === */
	var ground = platforms.create(0, 0, 'platform');
	ground.scale.setTo(2, 1);
	ground.body.immovable = true;
}

I hope someone has a solution for this.

thanks

Link to comment
Share on other sites

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