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


Similar Posts:


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

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 :: 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 :: Cannot Get Scroll To Go Past

Jul 22, 2010

I have an fla that has a scroll which is large, 4591.60 is there a limit where flash will scroll and then stop? I did not create the file but I cannot get the scroll to go past where it is now as there is more to the scroll.

View 1 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

Flex :: End Up Getting A Http 500 Error And Have Not Been Able To Get Past That?

May 24, 2011

I have used wsdl2js to generate the javascript needed to communicate with the service.However I end up getting a http 500 error and have not been able to get past that. I have looked through the provided examples from the Apache CXF download and I have done some searching and cannot find a solid example of creating the javascript client. A lot of examples seem to somehow access the wsdl file at runtime from a server but my javascript is already generated from the CXF tool and I just include the scripts.

Adobe Flex and AS3Another option I have considered is using Adobe Flex. I create a new Mobile Flex project in Flash Builder using the BlackBerry PlayBook SDK and Flex 4.5. However when I use the menu options to connect to a web service I get prompted with "This option is only available for flex projects."Are there any other options out there that provide a solution to this problem? If you need more information just let me know

View 1 Replies

ActionScript 3.0 :: Cs4 Will Not Let Rezise An Image Past 28.8

Sep 23, 2009

i have a movie clip symbol (its just a red square 1x1).

at frame 1 it is just in the centre at 1px x 1 px.

i go to frame 60 ( the end of the movie clip ) and i want 2 resize it quite a bit.

but it WILL NOT let me resize past 28.8 for widht and height.

p.s. if i remove the tween then i can resize it to my hearts content.

View 0 Replies

ActionScript 3.0 :: Movie Not Getting Past The Preloader

Feb 8, 2010

I've got a couple of questions regarding the same project.

1- When you view URL... in IE, you'll notice that it sometimes doesn't go past the preloader. I asked why this happened in an IRC channel, and was told to use swfobject. However, with swfobject, I have the same problem. Is something else the problem?

2- I have the code [code]

View 2 Replies

ActionScript 2.0 :: Getting The Date With Past Days?

May 9, 2010

I've got a number of days from the date to today. Like 1689 days. How can I get from this the date subtraction past days with date?

View 1 Replies

ActionScript 2.0 :: FMX: Cannot -= _x Value Past Zero With Small Numbers?

Jul 7, 2004

I am having a little trouble understanding why my code is not functioning. It works if I subtract and combine numbers above .1 but if I use a number below .1 the _x and _y values stop at 0. I would like the _x and _y values to go into the negative. I am using Flash MX.

function movePastCorner(mc){
mc._x = 2;
mc._y = 2;

[code]......

View 2 Replies

ActionScript 2.0 :: MC Advances Past Its Max Y Position?

Aug 24, 2009

I have a scroller mc that I want to control by clicking underneath its y position to advance it down its y axis by a predetermined amount.The below code works to move it, but it advances past its max value of 496.5 (off the screen).Have I made a mistake in the code below? The scroller mc and associated text block is in their own mc on the root timeline. This code is on a frame on the root timeline.Has it got to do with the relative y positions of the stage compared with the y positions in the actual MC that I am trying to control?

Code:
principals_mc.johnTxt_mc.scrollerZone_mc.onRelease = function () {
var scrollerAmount:Number = 80;
if (this.hitTest(principals_mc.johnTxt_mc.jfscroller_mc)) {[code]......

View 6 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 3.0 :: Buttons Don't Work Past First Scene

Aug 17, 2009

in the first frame, first scene. Shouldn't that be where I but the include? (the buttons do work in scene) The buttons that are defined in external.as work in the first scene, but not in the other scenes. When I do an "include" in every scene, I get errors, no buttons work (makes sense....that should throw errors).

[Code]..

View 4 Replies

ActionScript 3.0 :: GotoAndPlay() Doesn't Go Past A Certain Frame?

Apr 27, 2010

gotoAndPlay() is the only actionscript I have in my flash and all I want it to do is go to a frame. If I tell it to go to a frame past a certain one it will not. It always (unless I pick a frame previous to the messed up one) goes to that frame. I have only one scene.

View 10 Replies

ActionScript 3.0 :: Lock The Stage So Cannot See Past Edge?

Feb 7, 2010

my stage is set at 500x400 in flash cs4. I created a rectangle for the background and set the same size as my stage that covers the whole stage but I noticed when I hit ctrl+enter to test the movie clip, it initially looks fine but when I expand the window large, you can see white area all around.

View 3 Replies







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