Hello Scratchers,
I'm new to scratch and am making a game. I've got our character moving around,
with a simple walk cycle. When he touches a treasure chest, he is rewarded with
a sword.
How can we make him walk with that sword from that point on?
We are using the arrow keys to make him walk.
Any help greatly appreciated!
-Jon
Offline
probably the best way is to use costumes
when gf clicked //character set [sword v] to [no] //"sword" wil determine if the chracter has a sword forever if <key [right arrow v] pressed?> change x by [2] end if <key [left arrow v] pressed?> change x by [-2] if < (sword) = [no] > switch to costume [nosword v] end if < (sword) = [yes] > switch to costume [sword v] end when gf clicked //chest set [sword v] to [yes]then add a sword to costume "sword"
Offline
destructo-serpent wrote:
probably the best way is to use costumes
when gf clicked //character set [sword v] to [no] //"sword" wil determine if the chracter has a sword forever if <key [right arrow v] pressed?> walk cycle end if <key [left arrow v] pressed?> walk cycle end if < (sword) = [no] > switch to costume [nosword v] end if < (sword) = [yes] > switch to costume [sword v] end when gf clicked //chest forever if <touching [character v]?> set [sword v] to [yes]then add a sword to costume "sword"
hope i helped
fixed some mistakes
Offline