Hi, I have some students making some games and I am going to need help helping them with things I don’t know!
I have a student who has based her game on Chase the pizza but she wants to make more levels - She wants to change levels every ten points and this means that the background will change and the timer will reset…
several ways to achieve this, but here’s one you can try; you can wrap the change score by block in a function, and update values when it crosses certain thresholds:
(note that if you start adding more than one point at a time you’ll need to massage it a little instead of just score score === 5, but that’s a good place to experiment to figure out – the main things you’ll wanna note are changing it to a >= & possibly comparing what it was at the start to what it was at start + the value being added to see when it ‘transitions’ past the point of 5 / 10 / etc).
Here’s another example where it’s a bit more complicated, adding in extra objectives but lowering time to get them all
But again, lots of ways to do this / this is just one approach so we should see what other ways people think of as well
So you could use a variable to be set forever as the score, then use an “if” block which detects whether that variable set to the score is 10 points. Then change background, and reset timer.
Thank you so much! This is really helpful and will allow her to create her levels. I understand how you have done it so I can try to explain it to her!