Making a Slideshow in Game Lab

I have a student working on a project, and we’re stuck. The project is supposed to change pictures when you press the space bar, but instead it skips to other slides. Can you make a recommendation? Link is attached. Thanks!

@krtokarczyk I’d be glad to help. Please post a link to the project by clicking the share button on the top left of the menu bar.
image

Thanks @mmathews for your help. I think we’ve enabled the share feature. Here’s the link. Huge thanks if you have time to answer today because my student is sharing his project tomorrow.

Hi, this is a really ambitious project that goes way beyond the scope of the course!

I’m unclear why the student thinks that pressing the space bar should change pictures (actually not quite sure what that means specifically) rather than switch to slide 2, because Lines 34-36 switch from slide 1 to slide 2 when the space bar is pressed.

There are a couple strange things I’m not sure what is happening. What are the time variables for? Why do they change the behavior based on how much time has passed since the beginning of the game? I don’t understand what the program is supposed to do, specifically.

Also, the student does not need to destroy the sprites when switching to the new slide. It is enough just not to draw them. Destroying them isn’t really going to help anything.

Elizabeth

1 Like

@krtokarczyk This was a complicated project. I had to break this down to two functions.

  1. You can advance to the next slide by clicking on the space bar
  2. or after 5 seconds.
    https://studio.code.org/projects/gamelab/oVcLIcx0iCwrovw0pyffEixVbu4iqc0-bMk_Jc6Ew_w
1 Like