c, im making a fighting game and im almost finished!! i just need to kno.....i cant explain, so heres an example.
what if im a flower, and im fighting a ball. When i attck the ball, the health goes down to 0. how do i make it stop at 0, and say that the flower wins?? or vise versa(like if the flowers heatlth goes down to 0, and that the flower loses?). I hope u understand what im trying to say! Thanks!!
- Rukia Kuchiki
<forever>
Offline
Try something like this
when flag clicked
wait until flowerHP<1
broadcast ballWins
when flag clicked
wait until ballHP<1
broadcast flowerWins
Something like that.
Offline
archmage wrote:
Try something like this
when flag clicked
wait until flowerHP<1
broadcast ballWins
when flag clicked
wait until ballHP<1
broadcast flowerWins
Something like that.
can u show me in the block form plz?
Offline
keroro645 wrote:
<forever>
<if><( <{ P1 Life }> <>> 0 )>
Put scripts for p1.
<end>
<if><( <{ P1 Life }> <=> 0 )>
<broadcast[ P2 win ]
<end>
<end>
ok......u put it to where i could understand it, but now im confused.
Offline
Ok I am going to try to explain it more clearly.
Both your sprites need to have some sort of variable for the sprites health.
To make the ball win the flower's health must be less than 1 and to make the flower win the ball's health must be less than 1. So what you do is you make a script that waits until one of the sprites' health variables is less than 1 then declare the winner.
Like this for the flower.
<when green flag clicked>
<wait until> <( <{BallHealth }> <<> 1 )>
<broadcast[ TheFlowerWins]
Last edited by archmage (2008-09-27 16:41:20)
Offline
im sry. but i still dont understand......u must think im so stupid......i tried doing that. but it didnt work. What if i told u, i had 5 sprites to choose from, and 1 sprite moved byitself and fought the other 5? Does that make a difference?
Offline
archmage wrote:
Ok I am going to try to explain it more clearly.
Both your sprites need to have some sort of variable for the sprites health.
To make the ball win the flower's health must be less than 1 and to make the flower win the ball's health must be less than 1. So what you do is you make a script that waits until one of the sprites' health variables is less than 1 then declare the winner.
Like this for the flower.
<when green flag clicked>
<wait until> <( <{BallHealth }> <<> 1 )>
<broadcast[ TheFlowerWins]
im sry. but i still dont understand......u must think im so stupid......i tried doing that. but it didnt work. What if i told u, i had 5 sprites to choose from, and 1 sprite moved byitself and fought the other 5? Does that make a difference?
Offline
Post the project and I can give you the exact code you need. But really all you have to do is check if the health variable is less than 1.
Offline
archmage wrote:
Post the project and I can give you the exact code you need. But really all you have to do is check if the health variable is less than 1.
ill post the project, but then ill update it, after u tell me. its a sailor moon fighting game.....ill post it now..
Offline