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

#1 2012-03-19 05:00:35

The1UP
Scratcher
Registered: 2011-11-01
Posts: 500+

Changing to the right costume at the right variable number

I've decided to stop using the variable for HP bars and made a sprite that is for that purpose.

However, while making the scripts I realised:

when gf clicked
forever if <[500] > (Desert Dragon HP)
switch to costume [costume 2 v]
It wouldn't work because I had mulitple scripts following the same thing.

Any suggestions?


Ya know what, no signature. You have this useless dialogue to look at now.

Offline

 

#2 2012-03-19 16:17:49

The1UP
Scratcher
Registered: 2011-11-01
Posts: 500+

Re: Changing to the right costume at the right variable number

Anyone? This is a school project that's due in soon!

For anyone confused about the 'forever if' part, there was meant to be '500 > Desert Dragon HP' but I guess it got lost.


Ya know what, no signature. You have this useless dialogue to look at now.

Offline

 

#3 2012-03-19 16:26:12

MrMonk999
Scratcher
Registered: 2011-12-17
Posts: 500+

Re: Changing to the right costume at the right variable number

The1UP wrote:

I've decided to stop using the variable for HP bars and made a sprite that is for that purpose.

However, while making the scripts I realised:

when gf clicked
forever if <[500] > (Desert Dragon HP)>
switch to costume [costume 2 v]
It wouldn't work because I had mulitple scripts following the same thing.

Any suggestions?

say you want the next decrease at 400, then use

when gf clicked
forever if<<[500] > (Desert Dragon HP)> and <[400] < (Desert Dragon HP)>>
switch to costume [costume 3 v]
then
when gf clicked
forever if<<[400] > (Desert Dragon HP)> and <[300] < (Desert Dragon HP)>>
switch to costume [costume 2 v]
etc.

Last edited by MrMonk999 (2012-03-19 16:29:11)


http://i.imgur.com/CAMJe.png

Offline

 

#4 2012-03-19 16:58:26

The1UP
Scratcher
Registered: 2011-11-01
Posts: 500+

Re: Changing to the right costume at the right variable number

MrMonk999 wrote:

The1UP wrote:

I've decided to stop using the variable for HP bars and made a sprite that is for that purpose.

However, while making the scripts I realised:

when gf clicked
forever if <[500] > (Desert Dragon HP)>
switch to costume [costume 2 v]
It wouldn't work because I had mulitple scripts following the same thing.

Any suggestions?

say you want the next decrease at 400, then use

when gf clicked
forever if<<[500] > (Desert Dragon HP)> and <[400] < (Desert Dragon HP)>>
switch to costume [costume 3 v]
then
when gf clicked
forever if<<[400] > (Desert Dragon HP)> and <[300] < (Desert Dragon HP)>>
switch to costume [costume 2 v]
etc.

Ah. Now that is an excellent idea. I have no idea why I didn't see that.

Ya learn something new everyday!


Ya know what, no signature. You have this useless dialogue to look at now.

Offline

 

#5 2012-03-19 17:30:08

MrMonk999
Scratcher
Registered: 2011-12-17
Posts: 500+

Re: Changing to the right costume at the right variable number

The1UP wrote:

MrMonk999 wrote:

The1UP wrote:

I've decided to stop using the variable for HP bars and made a sprite that is for that purpose.

However, while making the scripts I realised:

when gf clicked
forever if <[500] > (Desert Dragon HP)>
switch to costume [costume 2 v]
It wouldn't work because I had mulitple scripts following the same thing.

Any suggestions?

say you want the next decrease at 400, then use

when gf clicked
forever if<<[500] > (Desert Dragon HP)> and <[400] < (Desert Dragon HP)>>
switch to costume [costume 3 v]
then
when gf clicked
forever if<<[400] > (Desert Dragon HP)> and <[300] < (Desert Dragon HP)>>
switch to costume [costume 2 v]
etc.

Ah. Now that is an excellent idea. I have no idea why I didn't see that.

Ya learn something new everyday!

XD


http://i.imgur.com/CAMJe.png

Offline

 

#6 2012-03-20 04:17:53

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: Changing to the right costume at the right variable number

The1UP wrote:

MrMonk999 wrote:

The1UP wrote:

I've decided to stop using the variable for HP bars and made a sprite that is for that purpose.

However, while making the scripts I realised:

when gf clicked
forever if <[500] > (Desert Dragon HP)>
switch to costume [costume 2 v]
It wouldn't work because I had mulitple scripts following the same thing.

Any suggestions?

say you want the next decrease at 400, then use

when gf clicked
forever if<<[500] > (Desert Dragon HP)> and <[400] < (Desert Dragon HP)>>
switch to costume [costume 3 v]
then
when gf clicked
forever if<<[400] > (Desert Dragon HP)> and <[300] < (Desert Dragon HP)>>
switch to costume [costume 2 v]
etc.

Ah. Now that is an excellent idea. I have no idea why I didn't see that.

Ya learn something new everyday!

ifs... Better way;

when gf clicked
forever
switch to costume ((round ((Desert Dragon HP)/[100])) - [2])
t=is it -2? well, it said "switch to costume 3" if -2 doesn't work try -1 or something...

Offline

 

Board footer