JavaScript Introducing JavaScript Finishing the Game Wrapping It Up

Having trouble modifying the game using the teachers notes

Hi, I have been trying to follow the teacher's notes in this video and changing the sprite to 'mikethefrog.png' as well as changing the pixels to 32 width and length, but the game is not running. Can someone please help me? Here is my code:

game.load.spritesheet('player', 'mikethefrog.png', 32, 32); 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('star', 'star.png', 32, 32);

2 Answers

I Dilate
I Dilate
3,977 Points

Hi Paul,

When you say "the game is not running", what exactly is happening?

Are you getting any kind of error message at all?

Try opening your browser's Javascript Console to check for any potential error logs. You should Google to see how to open the Javascript Console in your browser, as it's slightly different between browsers.

Thanks, Rich

Hi Rich,

It must have been something with my google chrome browser. Today I added the code and it worked just fine.

Thanks Paul

I Dilate
I Dilate
3,977 Points

Hi Paul,

I'm really glad it's working for you now.

Perhaps an older version of the file was being loaded from your browser's cache.

It's worth knowing how to do a Force Refresh in your browser (refresh from the server, ignoring any cached files). In Google Chrome for Windows you can hold down the CTRL key while clicking the Refresh icon. Or hold CTRL and press F5.

If you're seeing any unexpected results when adjusting your code - or a page isn't updating despite changing your code, I recommend trying this solution.

All the best, Rich