Is there a way to create a Start Button?

So how do you make a start button on both the duck and weeding games there’s an actual start button that you click on to start the game. A student was asking and we looked through the code, but there is literally no code that we can see for the start button?

I thought it would be a sprite to click on, but it is not. I am wondering if these games were made in app lab instead then? One thing I think Code.org creators should seriously consider is merging app/game lab features. Would be nice as it is very hard and not convenient I find to create a game with levels.

Ben,

Good suggestion and it’s come from a couple other people so we’ll see. In the meantime you can make a sprite that is the last thing drawn (bottom of code) and then has an if that if clicked on isVisible = false. Not the best solution but could work.

Brad

Hi Ben,

As part of a proof-of-concept, I made a short tutorial on how to make start and end screens in Game Lab. It’s not polished, but if you want to take a look, then please message me and I’ll send it to you.

Elizabeth

Would you send me a copy of the tutorial, as well?

If I have time, I can try and make a tutorial, but I do have a simple project that demonstrates the concept.

When run, there is a green “Go” Button. When that button is clicked, it goes away and a car shows up. If you click on the car 10 times, the score will update and the game over screen will show up.

Hope this helps a little.

Mike

1 Like

Thank you so much for all your help! You helped me with this student’s project a couple of weeks ago, too. This is what we have so far. Now, I’m waiting to see what else he wants to put into it.
https://studio.code.org/projects/gamelab/7EtHLig9Iv1M_QinUy4O04JcFTy9j-0FQo4_wPBnQis

2 Likes

HI Elizabeth,

I just came across this discussion and wondered if the video you created is still available? I have a student who has a game over screen but then wants to restart the game. I have suggested creating a ‘button’ to press which makes the sprites visible and resets the variables but I am not sure if it is the best idea.

@lwilliams1,

I think your idea is a good one. To “reset” a game, you would want to hide sprites that need to be hidden (such as the game over sprite), reset the variables, and show the sprites that need to be shown. If designed well, a function could be made that does all of that. You call it at the beginning of the game and when you want to start over, you just call it again.

Mike

Thank you I thought it would have to be something like that. I share with my student today.