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 trialThomas Goepfert
Front End Web Development Techdegree Student 6,124 PointsEnd game
I added a lifecounter to the game and it works great, even has 'you lose' text. But after losing the game my character can still move around and collect coins. How do I make the game stop completely? Here is my workspace-https://teamtreehouse.com/workspaces/40804771
6 Answers
KRIS NIKOLAISEN
54,971 PointsThere is a player.destroy() method that causes the player to disappear. I added that after the 'you lose' message is updated, along with changing the background color.
Thomas Goepfert
Front End Web Development Techdegree Student 6,124 PointsThat worked! Thanks a lot all for your help.
Johnnt Trav
Courses Plus Student 1,295 PointsLink gives page not found. Can you update the link?
Thomas Goepfert
Front End Web Development Techdegree Student 6,124 PointsKRIS NIKOLAISEN
54,971 PointsIf you want to share a workspace you will have to create a snapshot. It is the camera icon in the upper right corner.
Johnnt Trav
Courses Plus Student 1,295 PointsHmm... weird. Can you take a snapshot instead? On the top right corner there a camera to take a snapshot of your workspace.
Thomas Goepfert
Front End Web Development Techdegree Student 6,124 PointsGotcha thanks! 2nd day here!
https://w.trhou.se/rjjmg9knhp
Johnnt Trav
Courses Plus Student 1,295 PointsYou can place this under both win and lost conditional statements.
player.body.velocity.x = 0;