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

JavaScript Introducing JavaScript Finishing the Game Final Code Challenge

star bringing

Click the preview button to view the game. Currently, there are 3 stars on screen. Click the Editor button and add two more stars, bringing the total number of stars to 5. Make sure none of the stars overlap with any other stars how can l do this please help me gays

1 Answer

Steven Parker
Steven Parker
231,275 Points

If you look at the code, you can find a function that is used to create stars. It's not hard to find because it's near the beginning and it's name is very self-descriptive.

Inside that function, you will see where it calls another function to create each star. So if you add more lines like the ones already there, you will get more stars.

Then each function passes argument values to determine where to put that particular star. You'll need to give your new stars different numbers to put them in new places. If you have trouble finding good spots, you can use the "preview" button to see where they currently are going and adjust your numbers to move them around.

I'll bet you can do it now. :wink: