This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

shrucis1
shrucis1 presents ...

2013/12/10

One-Time Play test

A little test I'm playing around with for future 'demo' projects.
Once you've run the scenario once, you'll see it fade from black to red. After that, a message will come up saying "Sorry! You've already played once". If you try to reload or reset the scenario, all that happens is that message.

The application of this is that if one wants a user to only be able to play a demo game three times, using something like this would perform such a purpose.

NOTE:
When not logged in, you can run the fade animation as many times as you want.

2242 views / 20 in the last 7 days

1 vote | 0 in the last 7 days

Tags: with-source

open in greenfoot
Your browser is ignoring the <APPLET> tag.
bournebourne

2013/12/10

In context of demos and the goal here, can't you just not let you play if not logged in?
shrucis1shrucis1

2013/12/10

Yes, if I was actually going to use this in an application to prevent users from playing a scenario more than a certain number of times, It would be impractical to let those not logged in play, as then users would simply log out to play again. I didn't implement this on this scenario, but if/when I use it with an actual purpose, I will implement it.

Want to leave a comment? You must first log in.

Who likes this?

herusaputra