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
Made my own practice game. I am stuck.
Hey all, Working off of the quiz we made here, I tried to make my own Hot or Not game. I made sample images that just show the numbers 1, 2, and 3, rather than showing pic of people. Each pic has an existing score. I am able to get the first score to display. I tried getting the buttons in the game interface to display the options 1 or 2 (1 will eventually be hot, and 2 will be not). I can not get the buttons to display 1 or 2. I don't know why. Can you help find the problem?
Here is the snapshot: https://w.trhou.se/z965v97cp9
Once I get there, I want to work on the voting aspect, when a vote of 1 (hot) will increase the current score by 1. A vote of 2 (not) will just move it to the next pic without raising the score.
Please help me out.
Thank you so much!
Steven Parker228,978 Points
A button will display the text placed between the start and end tags, as shown below using "Hot" but "1" could be used there instead:
<button id="guess0" class="btn--default">Hot</button>
Also, in pic.js I happened to notice "
this.votes === 1;", which is a comparison expression that does nothing by itself. Perhaps you intended to increase the value with an addition assignment, which would look like this:
this.votes += 1;
Oh, thank thank you very much. I will check it out and see what happened.
You are right. I was thinking about that. I am going to come back to this game when I have a bit more skill. I think it will be good practice. Thank you for your help.