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

#1 2009-12-03 08:16:00

a1chrisp
Scratcher
Registered: 2009-12-01
Posts: 2

Enemy Contact

ok i have an enemy and a hero character. when the hero character attacks the enemy it goes through the death sequence but while still moving through its course...

<when green flag clicked>
<forever>
<repeat( 7)>
<point in direction( 90)>
<change x by( 10)>
<wait( 0.2 )secsc>
<switch to costume[ Move2
<change x by( 10)>
<wait( 0.2 )secsc>
<switch to costume[ Move1
There are four more repeat blocks under this but they are pretty much the same thing escept in different directions. When it is on this path i  have the hero hit it and it will go into the death sequence
<when green flag clicked>
<forever>
<if><< <( touching[ Hero )> <and><( <{Attack}> <=> 1 )>  >>
<switch to costume[ Die1
<wait( 0.5 )secsc>
<switch to costume[ Die2
<wait( 0.5 )secsc>
<switch to costume[ Die3
<wait( 1 )secsc>
<hide>
and wont stop moving while its doing this ive tried so many different things to stop it but i cant get it to... so if some1 could give me a suggestion that would be great thnx!

Offline

 

#2 2009-12-03 16:08:06

TheSaint
Scratcher
Registered: 2008-11-04
Posts: 1000+

Re: Enemy Contact

Create a variable and set it to 0 when the flag starts.
When the enemy dies, set it to 1.
In each repeat block, put
If     Dead?   =   1
Stop Script
End If

Offline

 

#3 2009-12-06 20:53:41

a1chrisp
Scratcher
Registered: 2009-12-01
Posts: 2

Re: Enemy Contact

This worked ty so much the assignment is due later this week and this will help me finish it  big_smile

Offline

 

Board footer