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

#1 2011-10-08 09:43:00

rojasscratches
Scratcher
Registered: 2011-06-01
Posts: 59

how do you make a sprite switch weapons

I'm making a game that has a sprite change weapons can sum 1 tel me how 2 do it


smile   neutral   sad   big_smile   yikes   wink   hmm   tongue   lol   mad   roll   cool  cool  Scratch Home Page  cool

Offline

 

#2 2011-10-08 09:44:01

rojasscratches
Scratcher
Registered: 2011-06-01
Posts: 59

Re: how do you make a sprite switch weapons

bump


smile   neutral   sad   big_smile   yikes   wink   hmm   tongue   lol   mad   roll   cool  cool  Scratch Home Page  cool

Offline

 

#3 2011-10-08 12:04:56

iTweak0r
Scratcher
Registered: 2011-07-30
Posts: 100+

Re: how do you make a sprite switch weapons

rojasscratches wrote:

I'm making a game that has a sprite change weapons can sum 1 tel me how 2 do it

i have a script

[blocks]<when[ w ]key pressed>
<set{ weapon }to( weapon1
[/blocks]

and do that for all keys and weapons

then

[blocks]<when[ whatever key to fight ]key pressed>
<if> <( weapon <=> weapon1 )>
<broadcast[ shoot with weapon 1 [/blocks]

and extend that if for all weapons.


Make it in Scratch! because it's cooler when it's made in scratch
http://i.imgur.com/D4iqPHR.png

Offline

 

#4 2011-10-08 12:20:47

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: how do you make a sprite switch weapons

iTweakOr's method will work, but there's no real visible change. You'd have to either make a second sprite which is always staying in the guy's hand and switches costume based on the value of the "weapon" variable, or you'd have to make another costume for your first sprite where he's holding something differently, again, based off the value of the "weapon" variable.

Offline

 

Board footer