I doing a Kirby Super Star Ultra game and I need help with that.
Offline
The kind of block "variables" is good for values that can be changed or set to something, like health. So you could go to the "Variables" section on Scratch and make a variable called "Health", and change it whenever you lose or gain health. For example, for when your sprite is hurt:
when gf clicked forever if <touching color [bad color]?> change [health v] by [negative number you want] end if <touching color [heath restoration color]?> change [health v] by [positive number you want] end end
Offline
and if you want a health bar, just do many sprites(in one character).one full, next one less.. ect.
when gf clicked forever if< touching color [bad color]?> change [health v] by [negative # you want] next costume// aka health meter less end if <touching color [health restoration color]?> change [health v] by [positive number you want] switch to costume ((costume #) - (1))// previous costume( which means bigger health bar) end end
Last edited by gfchll (2012-08-13 19:45:21)
Offline
But what if it's not a bad color, what if its a bad sprite?
Offline
Let's say you have 4 sprites that are bad. You could do this:
1. Make a list of these 4 bad sprites. Name them exactly how they're named. For example, "Sprite One" would be put on the list as "Sprite One".
2. Add this script in the forever loop of the good guy (you):
when gf clicked set [on v] to (1) forever other scripts repeat (length of [list v]) if <(on) > [4]> // see below note :) set [on v] to (1) else set [on v] to ((on) + (1)) end if <touching (item (on) of [list v])?> change [health v] by (-1) // or any negative # you want end end
Hope this helps!
Note: the 4 in the statement with the comment with it should be the length of your list; if you had, say 20 sprites on the list than that "4" would be a "20"
Last edited by powerpoint56 (2012-08-15 18:53:14)
Offline