So, for my game I am going to have battle simulations, but I have no clue how to make "Random Hit Points". I know, just about, how to do the HP Bar, just not how to make the HP bar go down a random amount. Any ideas? Is that even available to do in Scratch or am I just wasting my time with trying? Please help!
Offline
Here's what you do.
Go to operators. Look for pick random from _ to _
Plug that into change health by _________
Then, add desired numbers to pick randomly from. Make sure both of the numbers are negative, and the smaller number goes first. (That is if you want to lose health)
If you want to have a random amount of hit points in the beginning, you would do a script as follows:
when gf clicked set health to (pick random from 1 to 100)
Offline
Use the 'pick random' block.
It is under the 'operators' tab.
(pick random (1) to (10))You could use it like this:
when I receive [attacked v] change [health v] by (join [-] (pick random (lowestattackpower) to (highestattackpower) ) ) other scripts here
Offline
trinary wrote:
Use the 'pick random' block.
It is under the 'operators' tab.(pick random (1) to (10))You could use it like this:when I receive [attacked v] change [health v] by (join [-] (pick random (lowestattackpower) to (highestattackpower) ) ) other scripts here
Using (join [-] (number)) will not negate negative values. If it tries to negate -26, it will produce --26, not 26. Use ((number) * (-1)).
Last edited by rdococ (2012-03-19 14:44:10)
Offline