I have created a two-player game, but wish to add an intelligent opponent that is not a friend. Does anyone know how to do this? I also wish to make it so that you can save a game, then return to it. Is there a way to do this? If you need to see the program to do this, this is the link: http://scratch.mit.edu/projects/skippito/2404160
Offline
create a public varible called player x position then add this to the person
when gf clicked forever set [player x position v] to (x position)then for the basketball
forever if <(x position) = (player x position)> change y by [-something] endhere is some thing that might help with saving a game.
Last edited by ftf841 (2012-04-04 17:36:02)
Offline
Thanks. I had to change your script a bit because Adobe Flash was not fast enough to run it, but this was only developing a range. Other than that, your script is very useful.
Offline
Hello!
If you want the project to save your progress, there is a relatively simple way to do this. (this will only work offline unfortunately.)
I'm on my iPod at the moment so I can't see your project, but I'll give you a pretty general explanation:
Let's say for example that you want the game to save what level you're on. Create a level variable (I'm assuming you already have something like this). Normally, when the player clicks the green flag, all the variables will be reset.
when flag clicked Set [level v] to [1]If you wanted the level you are at to save, simply don't add this script. When the player plays the game and advances to new levels, the variable will change. As long as the player saves the project, if the level variable is never reset, the level will be the same the next time the user opens the project.
Offline
ftf841 wrote:
create a public varible called player x position then add this to the person
when gf clicked forever set [player x position v] to (x position)then for the basketballforever if <(x position) = (player x position)> change y by [-something] endhere is some thing that might help with saving a game.
http://wiki.scratch.mit.edu/wiki/Saving_Data
or he could just use the
([x position v] of [player v])block.
Offline
AtomicBawm3 wrote:
ftf841 wrote:
create a public varible called player x position then add this to the person
when gf clicked forever set [player x position v] to (x position)then for the basketballforever if <(x position) = (player x position)> change y by [-something] endhere is some thing that might help with saving a game.
http://wiki.scratch.mit.edu/wiki/Saving_Dataor he could just use the
([x position v] of [player v])block.
That is what I did. It makes it so the game responds more quickly. The real problem was how fast Adobe Flash can refresh.
Offline
if you want to save and you have panther you could use files and then have it read the file to know you progress (only works offline)
Offline