Pages: 1
Topic closed
1. How do you make it so that a sprite bounces off when another one punches it?
2. How do you set the controls for a 2 player game?
3. How do you make a health meter?
4. How do you change a sprite's costumes when something happens? (Ex: when you press the punching button it changes costume to make it look like its punching?)
5. When a sprite is out of health, how do make the screen say "KO"?
6. How do you reset the sprite's locations at the end of a round?
(motion, control, and sensing categories)
Last edited by Kay23 (2009-01-31 17:55:13)
Offline
Kay23 wrote:
3. How do you make a health meter?
When I make health meters, I make 3 sprites. One that is white and does not have anything on it, another that is an exact replica of the first, but in a different color, and lastly a sprite that blends in with the background.
Here is the code for sprite one:
<when green flag clicked>
<forever>
<go back( 1 )layers>
<show>
[quote/]
Here is the code for sprite two:
<when green flag clicked>
<forever>
<go to front>
<go back( 1 )layers>
<show>
<set x to( (( <{ Health }> <-> ? ))
NOTE: These numbers are completely random. Lets say that the sprite is 100 pixels long and the max health you can have is 100. In that case, this would be perfectly fine. Otherwise, you might have to play around with the numbers and operations. The subtracting is for a health bar to the left, the adding is for a health bar to the right.
Here is the code for sprite three:
<when green flag clicked>
<forever>
<go to front>
<show>
<go to xRight to the left of Sprite 1 )y
Y position of sprite 1
NOTE: This sprite just covers the second sprite up, that way, you have the impression the sprite is disappearing.
This would definitely need to be edited to fit your needs. This would only work with a basic program. Mess around with a few things and it should work though.
Offline
kay23 wrote:
3. How do you make a health meter?
Make a sprite that has, say 10 costumes... 1'st has 10 bars. 2nd has 9 bars and so on.
Script for that sprite.
<when green flag clicked>
<switch to costume[1
<when I receive[ lose 1 health
<next costume>
<end>
See if it helps! :-)
Last edited by fg123 (2009-02-01 01:06:46)
Offline
fg123 wrote:
kay23 wrote:
3. How do you make a health meter?
Make a sprite that has, say 10 costumes... 1'st has 10 bars. 2nd has 9 bars and so on.
Script for that sprite.<when green flag clicked>
<switch to costume[1
<when I receive[ lose 1 health
<next costume>
<end>See if it helps! :-)
bad scripting, rather have something like
forever{
gotoCostume(health/10)
}
and have full hp be at costume 10 and one at costume 1
as for question one, just change the x/y positions
2) same as a one player game, only diffrent buttons
4) when i receave/if(something)
gotoCostume (X)
5) make a sprite that is full screen with the letters KO and add the following
if (health>0){
hide
} else {
show
}
6)when rouad finishes, set the x,y,direction ect to what you want...
Offline
Topic closed
Pages: 1