Health Bar and Ammunition

Game Editor comments and discussion.

Health Bar and Ammunition

Postby BlenderFreak » Tue Jan 11, 2011 2:29 am

My game I've been working on, The Nightmare Sword is being put on hold temporarily until I feel confident enough to continue working on it. Right now my computer can't handle making the sprites and I don't have enough memory to hold all of the 3D files it's taking to create all the animations. So I'm moving on to a simpler project, which is a spin-off of a 3D game I made quite some time ago. The game, called Space Conflict, is - you guessed it - a futuristic shooting game. Originally it was a 3D FPS, but now I plan on making a spin-off that's more Galaga-styled.
I spent several hours, however, trying to find a good hp and ammunition tutorial and couldn't find one. I know I've don't it before, and I even downloaded a few .zip files thinking they'd help. Maybe my brain is just shot but I need some help. Just some links to decent tutorials will do. I've already made the sprites I need for the game (apart from scenery, backdrops, etc. I've made the ships and explosions. 6 different kinds of enemies, and each enemy has several different forms. A total of 30 unique enemy ships), I just need to make it work. Here's a screenshot (just to show that I'm really working on it).
I just need a tutorial on making the health bar change based on the damage the player takes. For some reason I've forgotten how. Same thing goes for the ammo (actually called "Energy" in this game) - though that will depend on the "gun" actor.
If this game gets off to a good start, I might also turn it into a side-scrolling game, and create a sprite for the main character. I'll just see how it goes. Thanks for all you help guys, and hopefully soon I'll be able to get back to working on my initial project.
Gameplay_1.jpg
Space Conflict: Prototype

This game won't be too huge of a file once it's finished, so I'll be able to post it as soon as it's done! Hopefully that won't be too far from now. My main problem is the health and ammunition, as well as making the sound effects work, but those problems will be solved soon enough (I think). :D
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score

Re: Health Bar and Ammunition

Postby BlenderFreak » Tue Jan 11, 2011 3:17 am

Ah, another thing that's a bit more complicated.
I would like for the following to things to be possible:
1) Character bounds! The character will be bound by the camera and by the status bar on the left hand side (the image in the post is not up-to-date. The status bar is far more detailed now and is actually vertical, not horizontal. I don't know how to do this, however.
2) Enemies are kinda pointless if they just fly right by your character. So if anyone knows a method of setting up the enemies so that when they reach a certain point in front of the actor, they change their velocity to meet the player's velocity, which is -10y constant (so that they remain on the screen, facing the player instead of zooming past him and leaving the screen), that would be quite helpful.
3) When your character gets injured, he can go about 1 second without injury, collision, or shooting so that the player has the opportunity to compose his/herself before the battle resumes - much like in most arcade games or rpg games. Not sure how to accomplish this, though I can easily make a flashing sprite. Thanks again.
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score

Re: Health Bar and Ammunition

Postby sonicfire » Tue Jan 11, 2011 1:47 pm

1) You can always check for the ship´s x position on the screen in the draw event, and the limit movement. e.g. (if (x < 32) { x = 32 }) and if (x > xlimit...e.g..600 or whatever).

3) You change the ship´s animation to a flashing sprite, do a "CollisionState("Event Actor", DISABLE)" then create a timer in your ship actor (1 second) and there you change the animation back to normal and do a CollisionState("Event Actor", ENABLE);

Hope that helps :)
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: Health Bar and Ammunition

Postby BlenderFreak » Tue Jan 11, 2011 3:50 pm

That does help, man! That's a couple of issues solved! Thanks!
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score

Re: Health Bar and Ammunition

Postby Toasterman » Sun Jan 16, 2011 1:57 am

Not sure if you still need help with the (directly) unanswered parts, but thought I'd try
I'm hardly a guru in the ways of game editor, having started a little while ago myself, but I'll help if I can

You mentioned HP and Ammo/Energy tutorials; I'm sure there are few on the forum, but I don't know of any.
How I have done an HP bar in the past (and anything that would need a "bar") is create a variable handling health or whatever.
create actor: HP=30; Now if the ship gets hit by a bullet or something- collision: (destroy bullet) player.HP-=1;(or however much)
Now if the HP bar has 30 animations, you can set it like so: draw actor: animpos=player.HP; that way the bar will reflect increases + decreases in HP
This would work for ammo, energy, shields, or anything else

Also, you mentioned you wanted enemies to stop when they get within a certain distance of your player- that is simple enough
(in the enemy actor) create actor: yvelocity=3; draw actor: if( abs(y-player.y)<50){ yvelocity=player.velocity; }; or you could use the distance function
At this point they might randomly move right and left, shooting at you or whatever

On a side note, the ships you posted look pretty cool! :D
What program did you use to make them? (I'm guessing not ms paint)
"If there are no stupid questions, what kind of questions do stupid people ask? Do they get smart just in time to ask a question? -Scott Adams

Hey! I've got okayish internet now! Now I can try all those cool demos I've seen!
User avatar
Toasterman
 
Posts: 75
Joined: Thu Jul 22, 2010 4:22 am
Location: Drowning in Dial-Up Ocean
Score: 7 Give a positive score

Re: Health Bar and Ammunition

Postby AliceXIII » Sun Jan 16, 2011 4:32 pm

viewtopic.php?f=4&t=9093&p=63401#p63401

dark paradox's health bars are very useful it fill's in canvase's with a gradient color and let's you specify health max and health, just make some variables one for hpMax and one for Hp and everytime you get shot just decrease hp by a certain amount and the bar will draw accordingly :D
"Taking a breath of fresh air."
User avatar
AliceXIII
 
Posts: 325
Joined: Fri Sep 17, 2010 2:36 am
Location: victoria, texas
Score: 37 Give a positive score

Re: Health Bar and Ammunition

Postby BlenderFreak » Mon Jan 17, 2011 4:27 am

Thanks, guys! Yeah I do still need help haha xD I'm more of a graphics guy than a coding guy, to be honest. I'll try that stuff out as soon as I get the chance!
I actually used Blender to create my ships! It's a 3D graphics/game engine. I created the models, painted them, and then took the pictures - it's what I do for nearly all my graphics.
There's not much there yet, but you can find information on my current projects here.

https://sites.google.com/site/darkst3am/
User avatar
BlenderFreak
 
Posts: 55
Joined: Sun Sep 26, 2010 5:46 am
Location: His Computer
Score: 2 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron