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 trialCarey Chan
1,319 PointsPreview 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
4,270 PointsHi 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.
Samuel Morales Jr
6,521 PointsI'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
4,270 PointsI 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
Courses Plus Student 15,809 PointsDid 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
Courses Plus Student 15,809 PointsMake 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.
Stephen Cole
Courses Plus Student 15,809 PointsStephen Cole
Courses Plus Student 15,809 PointsCan you post your source code?