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

#1 2012-12-22 19:49:13

Blayer98
Scratcher
Registered: 2012-03-22
Posts: 100+

Stuck Again...

How do i make it so that when a sprite touches a certain color, it does a animation once and once only? i mean that it does the animation it's supposed to do, and not play it over and over again.

Here's the scripts:

when gf clicked
forever if <touching color [RED]>
play sound [f2f_hitg]
switch costume to [Death1 v]
wait (0.05) secs
switch costume to [Death2 v]
wait (0.05) secs
switch costume to [Death3 v]
wait (0.05) secs
switch costume to [Death4 v]
wait (0.05) secs
switch costume to [Death5 v]
end


http://i50.tinypic.com/16lwmlj.png
The first Collab to have it's very own Cloud Variables! Coming Soon!

Offline

 

#2 2012-12-22 20:48:28

mathfreak231
Scratcher
Registered: 2012-10-24
Posts: 80

Re: Stuck Again...

Add

 stop script 
directly after "switch to costume Death5".


~This sig is false~
I'm on teh wiki!

Offline

 

#3 2012-12-22 21:26:12

Blayer98
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: Stuck Again...

Still Stuck, i want my character to not move at all when he dies, but how can i do that? I can still move with arrow keys and WASD.


http://i50.tinypic.com/16lwmlj.png
The first Collab to have it's very own Cloud Variables! Coming Soon!

Offline

 

#4 2012-12-22 22:04:15

Blayer98
Scratcher
Registered: 2012-03-22
Posts: 100+

Re: Stuck Again...

Bump! I Will Kill Myself If No-one Gives Me A Proper Answer!


http://i50.tinypic.com/16lwmlj.png
The first Collab to have it's very own Cloud Variables! Coming Soon!

Offline

 

#5 2012-12-22 23:23:03

dariusz1221
New Scratcher
Registered: 2012-12-16
Posts: 8

Re: Stuck Again...

try the hide script

Offline

 

#6 2012-12-23 02:11:47

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Stuck Again...

Instead of "forever if", use "forever; if | else", and put the arrow/WASD key scripts in the "| else" part. And, at the end of the "if |" part, use a "stop script".

when gf clicked
set [deathCostume v] to [0]
forever
if <touching color [#FF0000]?>
play sound [f2f_hitg v]
repeat (5)
change [deathCostume v] by (1)
switch to costume (deathCostume)
wait (0.05) secs
end
stop script
else
MOVING SCRIPT HERE
end
Remember to set your first death costume to the first costume of the sprite.

Last edited by jontmy00 (2012-12-23 02:19:18)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#7 2012-12-24 05:02:56

notaloser
Scratcher
Registered: 2011-12-06
Posts: 100+

Re: Stuck Again...

Simple:

when gf clicked
forever if <touching color [RED]>
play sound [f2f_hitg]
switch costume to [Death1 v]
wait (0.05) secs
switch costume to [Death2 v]
wait (0.05) secs
switch costume to [Death3 v]
wait (0.05) secs
switch costume to [Death4 v]
wait (0.05) secs
switch costume to [Death5 v]
wait until <not(touching color [red])>
end

Last edited by notaloser (2012-12-24 05:03:22)


http://gifs.gifbin.com/1238409599_nom_nom.gifhttp://cdn3.lolzsquad.com/wp-content/uploads/2012/10/Come-here-I-want-to-tell-you-something.-.gif

Offline

 

#8 2012-12-24 05:18:25

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Stuck Again...

notaloser wrote:

Simple:

when gf clicked
forever if <touching color [RED]>
play sound [f2f_hitg]
switch costume to [Death1 v]
wait (0.05) secs
switch costume to [Death2 v]
wait (0.05) secs
switch costume to [Death3 v]
wait (0.05) secs
switch costume to [Death4 v]
wait (0.05) secs
switch costume to [Death5 v]
wait until <not(touching color [red])>
end

Read post #3, and your scripts are extremely inefficient.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

Board footer