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

#1 2012-09-24 02:56:58

JonCool48
New Scratcher
Registered: 2012-09-23
Posts: 2

Help make our character pick up and carry a sword

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

 

#2 2012-09-24 03:14:36

destructo-serpent
Scratcher
Registered: 2012-07-25
Posts: 1000+

Re: Help make our character pick up and carry a sword

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"


hope i helped  smile

Offline

 

#3 2012-09-24 03:17:59

destructo-serpent
Scratcher
Registered: 2012-07-25
Posts: 1000+

Re: Help make our character pick up and carry a sword

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  smile

fixed some mistakes

Offline

 

#4 2012-09-24 07:37:50

JonCool48
New Scratcher
Registered: 2012-09-23
Posts: 2

Re: Help make our character pick up and carry a sword

Thank you soooo much !
Yes, we were using costumes for the walk cycle.
Now we know how to add a sword!
Thanks!!!!

Offline

 

Board footer