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

#1 2009-10-04 08:27:23

wiimaster
Scratcher
Registered: 2008-09-17
Posts: 1000+

I Need Help!

Sorry if i didnt post this in the right section. i didnt know where to post it. a mod can move it if needed.



anyways, i need help with a game im making.

i need to know how to make points. kind of like the points in spore, were you can add parts only if you have enough points and that will take away a certain amount of points, and if you remove the part, it gives you all the points back.

any ideas?


http://i584.photobucket.com/albums/ss286/wiimaster1/Wiimaster_zps107dca4c.gif

Offline

 

#2 2009-10-04 09:03:27

wiimaster
Scratcher
Registered: 2008-09-17
Posts: 1000+

Re: I Need Help!

anybody?


http://i584.photobucket.com/albums/ss286/wiimaster1/Wiimaster_zps107dca4c.gif

Offline

 

#3 2009-10-04 09:30:12

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: I Need Help!

You can use a variable for the points, adding and subtracting points from the initial value whenever a part is added/removed (if that's what are going to do). ^^


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#4 2009-10-04 13:21:32

wiimaster
Scratcher
Registered: 2008-09-17
Posts: 1000+

Re: I Need Help!

MyRedNeptune wrote:

You can use a variable for the points, adding and subtracting points from the initial value whenever a part is added/removed (if that's what are going to do). ^^

but how do you make it so that you cant place the part if there isnt enough points?


http://i584.photobucket.com/albums/ss286/wiimaster1/Wiimaster_zps107dca4c.gif

Offline

 

#5 2009-10-04 13:25:37

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: I Need Help!

Code:

[if <(points) > (0)>]
[][change [points] by (-1)]
[end if]

Last edited by The-Whiz (2009-10-04 13:25:58)

Offline

 

#6 2009-10-05 03:31:13

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: I Need Help!

wiimaster wrote:

MyRedNeptune wrote:

You can use a variable for the points, adding and subtracting points from the initial value whenever a part is added/removed (if that's what are going to do). ^^

but how do you make it so that you cant place the part if there isnt enough points?

For each part, before running the script that adds the part, you can make it check the points variable's value to see if it is greater that/less than a certain value (cost of the part).

For example, if your part costs 50 points:

[blocks]<when[ part ]clicked>
<if>   <not> <( <{ points }> <<> 50 )> >>
      [script that adds part goes here]
<end>


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

Board footer