JavaScript Introducing JavaScript Finishing the Game Wrapping It Up

Ioana Sauluc
Ioana Sauluc
3,251 Points

I have hard time to add coins in the bonus game.

Hi everyone.

  1. I have hard time to add coins in the bonus game.
  2. I would like to make the background with gradient, but I don't know how to do it. Can someone guide me please. Here is my snapshot trying to add the coins in the game. https://w.trhou.se/xmgvqrd3vk Thank you

3 Answers

Steven Parker
Steven Parker
174,023 Points

In "game.js" you should be able to add more lines after line 22 for each additional coin. Be sure to give them different locations.

There are several issues regarding the gradient:

  • the CSS file should be loaded with a "link" element with "href" attribute, not a "script" with "src"
  • the "background.css" file has some HTML in it, but it should be pure CSS
  • the CSS is incomplete and needs to be inside a rule block with a selector
  • the gradient value should be part of an "background-image" property setting
  • the hex color code should not be in quotes
Ioana Sauluc
Ioana Sauluc
3,251 Points

I can't see if I overlapping the coins. I just to guide myself after the other values of the poison, stars and platforms, but I can't see it when I preview it. My screen is just the colour of the background. If I take out the line 146 the call of my function, I can see again the game. So I think I've done something wrong but I don't know what. I checked all the game 2 times, but I don't realise what is wrong. Thank you for reply

Steven Parker
Steven Parker
174,023 Points

On lines 64 and 65, you have "animation" (singluar) instead of "animations" (plural).

Ioana Sauluc
Ioana Sauluc
3,251 Points

Thank you very much...very much....hahahaha... and it worked