Add A Health Bar/percent Or Someway Of Health In A Shooter?

Sep 14, 2009

Im making a shooter. I want my player to have health. Its similar to galaga. The player instance is PlayerShip and the shot from the alien is AlienShotT i want 100 health and -10 health per alien shot.

View 1 Replies


Similar Posts:


ActionScript 1/2 :: Make Health Bar Go Down?

Aug 18, 2010

Alright, so after some work and a lot of mistakes, I made a health bar for my game. (This is in Actionscript 2) Basically, the code is on my main character's .as file, there is var maxHealth : Number = 100; var health : Number = 100; and further down the line... _root.healthBar._width = (health/maxHealth) * 200;.As a result, when I change the var health number lower, the health bar goes lower. Sweet! It works! Now I was wondering if any of you guys could help me code it so an enemy can inflict damage upon the main character. I have tried many codes but they have all failed. if(this.hitTest(_root.Monster)) { } What would I put in the brackets?

View 3 Replies

IDE :: Create A Simple Health Bar?

May 13, 2009

How do you create a simple Health Bar for Actionscript 3.0? I have been searching for this for a while, and all I ever find are AS2 tutorials. AS2 dates back to about 900 B.C. ; it is an archaic language and it needs to be left alone, FOR GOOD.

-Snivvle
--------------------------
"AS2 is for dinosaurs" - Snivvle, 2008
"AS2 is for people who are afraid to evolve" - Snivvle, 2009
"AS2 is for people I want to punch" - Snivvle, 2009

View 5 Replies

ActionScript 3.0 :: How To Make A Health Bar

May 31, 2010

i am a newbie in AS3 or should i say a total noob in actionscripts and flash itself.Currently i need help on how to make a health bar.Basically i need to make a health that decrease over time when the mouse clicks on it. Meaning:Example when there are like 4 objects, A,B,C,D A and B are objects that help that player score points and C and D are objects that make the health bar goes down. By using mouse event, i must make it able to detect the clicking when the object is being clicked.

View 2 Replies

ActionScript 2.0 :: Health Bar Keeps Going Past 100 When Healed?

Jul 25, 2009

i have an apple and the character the character can walk over and touch the apple when he touches it he gets 30 random health but then if he health is already 100 the apple will give him 130. ??? is their any way to make it so his health doesnt go past 100

heres the code on the apple

PHP Code:

onClipEvent (enterFrame) {
}
if (this.hitTest(_root.char)) {

[code].......

View 2 Replies

ActionScript 2.0 :: CS3 Nerd Wars Health Bar?

Nov 14, 2009

I need help with a health bar that I am trying to create for my game, Nerd Wars. I have 2 health bar, the players health bar that changes from weapon choice and an enemy bar which shows the enemy health when the players weapon choice is on.

Between the change animation I have put a few second for the enemy/player health bar to go down in. The health bars should be going down by a certain random amount between 40 and 60 and this is where I think the problem is. post code that would generate a random number between 40 and 60 and assign it to a variable. I think that would be a good place to start.

View 2 Replies

Flash 8 - Health Bar Lowers On Click

Nov 24, 2010

I already solved the healthbar problem. Now what I want to know is if there's a way to set a max number for my health. For example, when I click "heal", it goes way over the max HP which is 100. Is there a way to set the max number to 100?

View 1 Replies

ActionScript 1/2 :: Health += 10; Not Working (on A Button)?

Aug 19, 2009

Here is my code on a button, when you click the button it takes you to a certain frame and plays, it is meant to add 10 health. When I have it it 52 health, it doesnt go to 62 it goes to 92. When It is at 30 it doesnt go to 40 it goes to 100. why? please help.
 
on (release) {    onEnterFrame = function () {        if (_root.health <=90) {            gotoAndPlay("use");            _root.health += 10; // I have tried it so this bit of code is in the frame ("use") so it adds 10 health when it lands on that frame, didnt work.        } ////////////// only pay attention to the above.//////////////        if (_root.health<=100)

[code]...

View 4 Replies

ActionScript 3.0 :: Make A Health Bar And Stamina Bar?

Dec 20, 2010

codes regarding on how to create a health bar and stamina barfor example when you move your character sideways the stamina bar decreases.

View 1 Replies

Flash8 :: Health Bar Lowers On Click?

Aug 25, 2009

EDIT: I already solved the healthbar problem. Now what I want to know is if there's a way to set a max number for my health. For example, when I click "heal", it goes way over the max HP which is 100. Is there a way to set the max number to 100?

View 3 Replies

Actionscript 3 :: Created A Curved Health Bar?

Feb 21, 2012

I'm making a game with a health bar and I am trying to make a health bar that is curved.Currently I have a lineBar that has 20 segments that looks like this at the bottom left of the screen.What I'd like to do is write a function that goes through and modifies the scaleY of each to get a curved bar.I can easily scale them down in a straight line. So that it looks triangle ish

View 1 Replies

ActionScript 2.0 :: Create A Health Bar At The Top Of Screen

Nov 18, 2003

I am trying to create a health bar at the top of my game screen. I have gotten it to go down when the characters get hurt but no matter what i try i cant get the file to go to the next scene when health= 0.

View 10 Replies

ActionScript 3.0 :: Health & Money Variable In Game

Oct 28, 2010

I'm working on a game where I need to have a variable for money and a variable for Health, or in my case, I call it Energy. Most tutorials I'm finding are in AS2 and the AS3 ones are not this basic thing that I need. Basically, I have an item shop with a pizza button, and in their respective dynamic text fields, you can see the status of your Energy and your Money. So, let's say the person clicks the pizza to buy it, Flash will subtract 10 (for 10 bucks) from the person's total money value and add 15 for total Energy points.This is what I've written so far and I'm writing all the script in Flash, not outside using classes or packages. I can tell already that I'm missing something. How do I write it so that Flash knows to add 15 Energy from that Pizza button and can I update the values of the variables and kick off that mouse event in the same function?[code]

View 2 Replies

ActionScript 2.0 :: Go To Another Scene When Variable Health Reaches 0?

Feb 9, 2011

I have a game in which comets fall from the sky onto the player, and when they hit him helth gets decresed by 10 i want when health reaches 0(or less) for game to stop.

View 1 Replies

Can't Get Health Bar To Decrease / When Hitting Animation Occurs

Aug 21, 2009

I'm having problems with actions script in Flash 8.I'm trying to make a little side scrolling fighting game, i've got a character and an enemy which follows him and has an attack animation when close, but I can't get the health bar to decrease when the hitting animation occurs while in contact with the hero.[code]I put this script on an invisible square which appears during the attack animation, HERO is my hero's instance name and HP the health bar's. Whats suppose to happen is that the enemy goes for the attack animation which is of hitting the hero whith an axe, and when the invisible box hits the hero at that moment, the hp should go down..

View 1 Replies

ActionScript 2.0 :: Create A Health Bar At The Top Of Game Screen?

Nov 18, 2003

I am trying to create a health bar at the top of my game screen. I have gotten it to go down when the characters get hurt but no matter what i try i cant get the file to go to the next scene when health= 0.

View 10 Replies

ActionScript 1/2 :: Make A Health Bar - Doesn't Clear The Timer

Feb 25, 2010

I'm trying to make a health bar, it does down when you press a button. I used a timer. But it doesn't clear the timer, it just keeps on going.

[Code]....

View 5 Replies

Flash :: Text Based Health If Object Hit Then - 20 ActionsScript 3.0

Sep 20, 2011

I am create a little game just to get more experience in Action Script 3.0. What I want is: If you shoot. And the bullet hits. Than the text above should -20.. Say It has 100(health). And we hit. It will display 80. Second hit 60 etc. This is what I am having but it does not seem to work out.

[Code]..

View 2 Replies

ActionScript 2.0 :: Navigate To The Health+science Section On Each Site?

Jan 24, 2008

[URL].. If you navigate to the health+science section on each site, you'll notice in the dev, the XML displays properly. If you check it out in the first one (not dev) you'll notice a break or two between each line.

The swfs and XML are identical. Anyone know of a reason why it would change like that?

View 3 Replies

ActionScript 2.0 :: Way To Make Health Decrease By Decimal / But Show Whole Number In Textbox

Jan 9, 2010

I am making a flash game for a school project, and I decided to make a stick fighting game.once the enemy attacks the player their health just drains. The only way I can fix it is if I have a decimal instead of a whole number, but I have the variable of the health in a text box to display the players current health and it doesn't look to good with a decimal number.So, I am wondering if there is a way to make the health decrease by a decimal, but show a whole number in the textbox.[code]

View 2 Replies

ActionScript 2.0 :: [Flash8] Making "Health" System?

Jun 19, 2008

I'm trying to add a system of health to one of my games.The actionscript I'm using doesn't seem to be working, and I've tried many different variations.This is what I'm trying to use:
In Frame 1 Actions:

_root.health=25;

if(_root.character.hitTest(_root.enemy))
if(health>0){[code]...

View 3 Replies

ActionScript 3.0 :: Make A "health Bar"?

May 16, 2011

I need a tutorial on how to create a "health bar" - I don't have a better word for it, but my idea is to have a bar (showing hapiness of a pet), and each time you push a button - the pet gains hapiness - and the "health bar" grows. What is this called, and is there a guide I can read telling me how to create such a code?

View 6 Replies

[CS3] Score Counter In A Shooter Game

Nov 24, 2008

I have a simple shooting game set up. 25 monsters appear on the screen, one after another, until no monsters are left. If you hit one before it disappears, the score increases. If you don't, the score stays the same.

In the actions frame, I placed an empty dynamic text box named score, and set it equal to 0 (declared in the main actions frame). But, seeing as though the monster actions are coded into the library item itself, do I have to declare score, and the score increase there instead?

View 4 Replies

F8 :: Glitchy Arcade Shooter Game

Aug 15, 2009

I've only played around with a dressup and dating sim - and coding using actionscript (and coding in general, only done a little bit of VB and Python before). I've been following a nice arcade side-scroller tutorial on this site which has three parts, if you want to view and go over them to help. It was designed for Flash 5 and I'm using Flash 8 Pro.[code]Anyway, as I was going through and coding/drawing the whole thing I came across a lot of problems and glitches (and a lot of times when the game coding would crash and I'd have to abort it and remake the entire coding again). I sort of stumbled around blindly, deleting and editing code to get things to work, and I'm up to the point where I'm almost finished with the thing. It's still glitchy though.I was wondering if any Flash coders could help me out?I'm going to be creating a Flash game for my programming class and I would prefer if it wasn't screwy (if I need to remake it with less cutesy graphics). xD;; If you could download the .Fla file and fix the coding problems I have.

Playable SWF game on my deviantart account.FLA downloadable file (@ Mediafire; no viruses, trojans, blahblah attached)The enemies tend to randomly explode before the missile has even hit them.The original enemy movie clip doesn't even want to explode.The score counter won't tick for each kill.The boundary box (?) of the player/enemy seems to be too big. You die before you should - in certain positions the enemy gets close and I guess the boundary boxes hit, which initiates the hitTest. It seems premature though, I'm wondering if I can reduce the boundary box, or have it so the enemy and player collide on the actual graphic, and not the movie clip box? I have no idea if this makes sense, I hope it does.There seems to be a bunch of other small glitches too.

View 6 Replies

Memory Leak In My Shooter Game?

Oct 20, 2011

I'm very new to flash,and have been digging through google and this site for information on how to piece together an AS2 shooter game.Its going well enough, but I'm having slowdown issues the longer the games runs, and I was hoping someone here could point me in the right direction.To paste an enemy movie clip on the screen, i'm using this:

Code:
var spawn =_root.attachMovie("monster1","monster1"+_root.getNextHighestDepth(),_root.getNextHighestDepth())[code]........

I need them stored in an array so that the player's shots can test weather or not they've hit any monster on the bullet's enter frame function, then call that monster's movie clip's take damage function. I'm using a for loop to do this:

Code:
for(var i in _root.player.foes){
if (this.hitTest(_root.player.foes[i])){
_root.player.foes[i].takedamage();}
}

I think the problem with the slowdown is that each time I place an enemy on the screen the array gets bigger and bigger. The slowdown only happens while the player is shooting, and I suspect the ever longer for loop with the hit testing is causing it.

I'm already removing the monster's movie clips as they get killed or exit the screen, I guess what I need is a way to reduce the size of the array at the same time, or at least tell the for loop not to do a hit test unless the monster is still alive.

View 3 Replies

ActionScript 2.0 :: Making A Top-down Shooter Game?

Mar 17, 2004

I'm making a top-down shooter game. I have keyboard input that moves the ship around and fires a laser.everything works perfect except that when the ship moves diagonal up left, or diagonal down right, the laser can't fire at the same time. It will work in any other direction, including the other diagonals. Just not those two

[Code]...

is this a common problem among movement in games? or do I just need to fix something?

View 1 Replies

ActionScript 3.0 :: Developing An Horizontal Shooter Game?

Jan 10, 2012

I just started developing an horizontal shooter game, but how can i make enemies ( movieclips ) moving randomly around the screen?

View 1 Replies

ActionScript 2.0 :: Virtual Shooter - Pause The Game?

Mar 14, 2008

I am playing around with the Vertical Shooter by Ernesto Quezada aka _Bruno

link on kirupa: http:[url]....

how can I pause the game.I added a button, but I need the right coding in AS2

View 1 Replies

ActionScript 2.0 :: Creating A Vertical Shooter Tutorial

Jan 24, 2011

I'm a bit of a newbie to this so I decided to follow this URL...The problem is that the dragons don't stop so I tried adding a time limit like this:[code]Frame 6 is my game over screen and the removeMovieClip works for the knight and the arrows but not for the dragons. They still carry on.

View 2 Replies

ActionScript 2.0 :: Make An Overhead Shooter Game?.

May 18, 2011

Im attempting to make an overhead shooter game. Ive got the basic movement down already, and rotation towards mouse. For when he shoots, ive set it to duplicate a bullet movie clip, but i only understand how to set it towards one graphical direction(ex: x +, y -)

The code i know ive gotta fix is

onClipEvent (enterFrame) {
this._x += laserMoveSpeed;
if (this._x>1000) {
this.removeMovieClip();
}
}

The little x + part has to be fixed, but i have no idea what to substitute in order to make it shoot from the front.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved