Trigun 2D Mega Man Style Health

Talk about making games.

Trigun 2D Mega Man Style Health

Postby josh_sg1 » Mon Jul 04, 2005 4:41 pm

I need help making a mega man style health meter for my character.

I also need to know how to make it decrese and increase like mega man when he gets damaged.
josh_sg1
 
Posts: 17
Joined: Fri Apr 29, 2005 8:53 pm
Location: usa michigan
Score: 0 Give a positive score

Postby jazz_e_bob » Tue Jul 05, 2005 3:36 am

What does it look like?

How does it behave?
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Tue Jul 05, 2005 6:55 am

Image

Hello,
You should have an animated health bar. If you have, let's say 5 lives in the meter, you should have something like this :

Image

Image

Image

Image

Image

Image

Then Download the demo here

Hope it helps.
See you 8)
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

:p

Postby josh_sg1 » Thu Jul 07, 2005 3:49 pm

Thank you. My only problem is that after I made the animated health bar.... I attached It to the view. Now how to get it to change the animation every time he looses health. There is 30 bars.

I also want the health bars to be able to be increased during the game but that I will get into later. Like mega man, when in game you find health and it restores your health meter.

Do I use scripting? I use donuts to re-fill the health.

Right now I just need to know how to change the animation on projectile collision. All projectiles decrease a different amount of health.

Lasers, bullets, machine gun bullets, bombs, fire, explosions, metal cannon balls, and so on.

||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||
||||||||||||||||||
|||||||
||
0
Destroy actor, creat actor-explosion (like mega man but different)

That is my main concern at the moment is getting that health metter to decrease like changing the animation a certain number of frames. The moon defender tutorial did'nt realy help but ill do it again if thats what it takes.
josh_sg1
 
Posts: 17
Joined: Fri Apr 29, 2005 8:53 pm
Location: usa michigan
Score: 0 Give a positive score

Postby ingsan » Sat Jul 09, 2005 8:59 am

Hello :)

What you want to do is very simple to deal in GE. In fact, you'll need only one conditional variable.
Let's call it health (integer variable that you'll have to create in the Script Editor)

On your Healthmeter Actor :
Event CreateActor > Action Script, write :
Code: Select all
health = 30 ;  // Use 30 because of your 30-frame animation

ChangeAnimationDirection("Event Actor", STOPPED); // to stop your animation from launching at game start

animpos = 30 ; // Remember, animpos starts at 0. If your first animation sprite is numbered 0, then animpos is called from 0 to 30. Else, if it is numbered 1, animpos is called from 0 to 29. Here, let's say that it starts at frame 0


    ------------------------------------------------------------------------------------------
Quote : Now how to get it to change the animation every time he looses health
On Collision Event with each ennemy (Lasers, bullets, machine gun bullets, bombs, fire, explosions, metal cannon balls, and so on) > Action Script, write :
Code: Select all
health = health - B ;
// where B is to be replaced by the amount of decrease you want, depending on the colliding actor
// Ex : Colliding with laser means health = health - 5, Colliding with bombs means health = health - 10, and so on

animpos = animpos - B ; // your meter animation will change animation by B frames

if (health < 0)
{

// DestroyActor
// Change animation to Explosion animation

}
 


Quote : I use donuts to re-fill the health
On Collision with Donuts, Action Script, write :
Code: Select all
health ++ ;

animpos ++ ;

if (health > 30 )
{

health = 30 ; // to limit the meter to your 30-frame animation

}


Bingo ! Now, good luck 8)
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby willg101 » Sat Jul 09, 2005 7:12 pm

Couldn't you also do, with the same animation and health settings, animpos=health ?
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

wow

Postby josh_sg1 » Sun Jul 10, 2005 3:50 pm

Oh my god. Thank you so much.

You have no idea how much I needed that. That was exactly explained how I needed it to be. Holy cow.

I have another hard question but I am going to pm it to you.

Here is my health meter
Image
josh_sg1
 
Posts: 17
Joined: Fri Apr 29, 2005 8:53 pm
Location: usa michigan
Score: 0 Give a positive score

Postby ingsan » Tue Jul 26, 2005 3:12 pm

Couldn't you also do, with the same animation and health settings, animpos=health ?

Of course Yes 8)
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby josh_sg1 » Sun Aug 21, 2005 3:32 am

cool. So this will help alot.
josh_sg1
 
Posts: 17
Joined: Fri Apr 29, 2005 8:53 pm
Location: usa michigan
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest