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

Carey Chan
Carey Chan
1,319 Points

Preview in Workspace for this video is blacked out for me.

Only for this video does my preview for workspace not work. All the other videos I've tried do work.

3 Answers

Raviv Fontaine
Raviv Fontaine
4,270 Points

Hi Stephen:

Yes, I'm so sorry for not responding sooner - been traveling for work and this notification got buried in my e-mail.

EDIT: I just fixed it! There was a stray parentheses that had managed to worm its way into the coordinate locations. Whoops...?

Thanks for all your help! Sometimes it just takes looking at it with fresh eyes, I guess.

I've been scratching my head for the last 10 minutes trying to figure out why I'm getting a black screen, then I noticed I made the same mistake and added extra parenthesis! Thanks!

Raviv Fontaine
Raviv Fontaine
4,270 Points

I am having this issue as well. I added the following code to lines 27-29:

createItem(100, 375, 'poison'); createItem(250, 250, poison); createItem(125, 50, 'star');

and

game.load.spritesheet('poison', 'poison.png', 32, 32); game.load.spritesheet('star', 'star.png', 32, 32);

to lines 96 and 97. I get a blank black screen in the preview mode.

Stephen Cole
Stephen Cole
Courses Plus Student 15,809 Points

Did you see my answer? Did it help?

Also, if you use Markdown, it will make your code easier to read in the forums. There's a great class for it here in Treehouse.

At the top of your code snippet, put three backticks (`) in a row, followed by the word: javascript

The backtick is below the ESC key on most keyboards

Then, on a newline after your last line of code, put three backticks by themselves.

Stephen Cole
PLUS
Stephen Cole
Courses Plus Student 15,809 Points

Make sure you don't have a syntax error.

looking at your code above:

createItem(100, 375, 'poison'); 
createItem(250, 250, poison); 
createItem(125, 50, 'star');

The second line is missing quotes around the word poison.

If you open the console you night see an error message. Cmd+Opt+J (for Mac) or Ctrl+Shift+J (Windows) to show it. If there is an error, it will tell you.