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

#1 2012-05-17 05:04:50

Zigz1
Scratcher
Registered: 2012-05-15
Posts: 60

How do I do this?

I want to make a sprite change costumes, and stop changing them if it reaches the specified costume. How? I have no idea.


http://i.imgur.com/b8VaZNv.png
Click to go on my collab's website "Dandelion"!

Offline

 

#2 2012-05-17 05:20:10

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: How do I do this?

You can use this script.

when gf clicked
repeat until <(costume #) = [7]> //Set the value "7" to whatever value you want, or you can set it to a variable.
 next costume
 wait [0.5] secs //Change this how long you want the script to wait before moving on to the next costume
end

Last edited by jji7skyline (2012-05-17 05:20:44)


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2012-05-17 05:54:29

Zigz1
Scratcher
Registered: 2012-05-15
Posts: 60

Re: How do I do this?

Thanks alot, I just had to change to:

if < (costume #) = 5>

else
say derp for 2 secs
Now, I have another question, what if I want to do like this:

You use a magnet and the enemy is lured to you, then you use an anvil and it misses because the cog is away from the place where it is supposed to hit. How?


http://i.imgur.com/b8VaZNv.png
Click to go on my collab's website "Dandelion"!

Offline

 

#4 2012-05-17 05:59:09

Zigz1
Scratcher
Registered: 2012-05-15
Posts: 60

Re: How do I do this?

I also need to make it like this: if health is 0 or under, there is game over/WIN.


http://i.imgur.com/b8VaZNv.png
Click to go on my collab's website "Dandelion"!

Offline

 

#5 2012-05-17 18:11:31

wow
New Scratcher
Registered: 2012-05-17
Posts: 1

Re: How do I do this?

when gf clicked
repeat until <(timer) > [10]>
  go to [mouse-pointer v]
end
think [Scripts in your posts!] for (3) secs

Offline

 

#6 2012-05-17 18:48:58

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: How do I do this?

if <<health> < (1)
   broadcast (win)
end
 
 
when I recieve (win)
switch to background (background2)

Last edited by Firedrake969 (2012-05-17 18:50:03)


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#7 2012-05-18 01:57:28

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: How do I do this?

Firedrake969 wrote:

if < (health) < (1) >
   broadcast [gameover v]
end
 
 
when gf clicked
switch to background [background1 v]
when I receive [gameover v]
switch to background [background2 v]

Fixed.


http://trinary.tk/images/signature_.php

Offline

 

Board footer