This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-12-29 00:12:08

Minecon
Scratcher
Registered: 2011-12-28
Posts: 4

Have you wanted to make a game that can save?

Have you ever wanted to make a game that can save and load its variables? Well, you have found the right place because I will show you the quick and easy steps to making one.

First, go onto the stage's scripts page. Next, grab the "When space key pressed" and change it to what button you want to save the game. Then, grab a "wait 1 secs" and put it under the "When 1 key pressed". Now change it to "0.125". After that, make a list and call it "save1". Drag "replace item 1 of save1 with THING" under the "wait 0.125 secs". Then, grab your variable and place it on the "THING" so it now says "replace item 1 of save1 with (Variable name)". It should look like this.

<when[ 1 ]key pressed>
<wait( 0.125 )secsc>
Replace Item (1) of save1 with <{ coins }>

If you want to make more variables just study the changes on this script

<when[ 1 ]key pressed>
<wait( 0.25 )secsc>
Replace Item (2) of save1 with <{ Points }>


Now we have to make the loading part of this project. First, place a "When I receive Load1". Next, drag a "set coins to 0". Last but not least, grab a "item 1 of save1" and place it where the 0 is. You are now done. It should look like this.

<when I receive[load1
<set{ coins }to( item 1 of save1

If you want to put in anther variable just study the changes.

<when I receive[load1
<set{ coins }to( item 2 of save1

I hope this will help you with scratch

smile

Offline

 

#2 2011-12-29 02:12:25

nickbrickmaster
Scratcher
Registered: 2010-02-02
Posts: 500+

Re: Have you wanted to make a game that can save?

Not advanced topics.

Just so you know, AT is for, well, AT. This includes mods, editing scratch, and programming.


Ask me what I'm doing, wait an hour than roll a die, if it's 4-6, I'm playing Skyrim, if it's 1, I'm eating, if it's 2-3 I'm programming.
Steam: nickbrickmaster | RotMG: PwnThemAll | Minecraft: nickbrickmaster | League Of Legends: BaneOfTitans

Offline

 

Board footer