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
Shari Staten
11,540 PointsGame does not view in JavaScript.
I'm building the game in JavaScript; adding a star and a coupe of bottles of poison. When i refresh the screen is either black or the blue background with no graphics. If I am not mistaken, shouldn't a graphic be created first and then called? I followed the instructors suggestions in the teachers notes and the result is the same. Or at least I think I did:
function addItems() { items = game.add.physicsGroup(); createItem(375, 400, 'coin'); createItem(575, 500, 'coin'); createItem(225, 500, 'poison'); createItem(100, 250, 'coin'); createItem(575, 150, 'coin'); createItem(525, 300, 'poison'); createItem(650, 250, 'coin'); createItem(225, 200, 'coin'); createItem(375, 100, 'poison'); createItem(125, 50, 'star'); I replaced coins with bottles of poison, then loaded the spritesheet: //Load spritesheets game.load.spritesheet('player', 'chalkers.png', 48, 62); game.load.spritesheet('coin', 'coin.png', 36, 44); game.load.spritesheet('badge', 'badge.png', 42, 54); game.load.spritesheet('poison', 'poison.png', 32, 32); game.load.spritesheet('poison', 'poison.png', 370, 500); game.load.spritesheet('poison', 'poison.png', 100, 375); game.load.spritesheet('star', 'star.png', 125, 50); } What am I doing wrong?
Thanks in advance for the advice.