Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing JavaScript Finishing the Game Adding Animated Characters

Can't get the star!

line 29, under add collectible items createItem(125, 50, 'star');

and in line 97 i added this under the before game beings game.load.spritesheet('star', 'star.png',32,32);

what did i miss?

Kevin Gates
Kevin Gates
15,053 Points

Can you add all of your code? Don't forget to use the Markdown Cheatsheet. So javascript will be:

backtick backtick backtick javascript **your code backtick backtick backtick

So something like this:

var yourVariable = example;

1 Answer

I added the same code and the star appeared. But the code was added to lines 27 and 93. For creating the item line 29 is outside the addItems() function. And for the spritesheet line 97 is outside the preload() function. Or did you add several blank lines?