Be a Supporter!
Response to: Constantly fecrease health Posted December 26th, 2012 in Game Development

Ok I played a bit with the code and this is what I have

do{

_root.pl+=random(10);

}
while(_root.pl<=100)

so the point is add health while health is lower than 100. But it freezes. Does anyone know why?

Response to: Constantly fecrease health Posted December 26th, 2012 in Game Development

At 12/26/12 05:51 PM, MintPaw wrote: Yeah, using AS2 is a very very bad practice for someone who wants to be a good programmer at some point, if you're more of an artist and I don't really care how good your coding abilities are then AS2 is for you, that's what it was designed for. If you actually want to program larger games in the future then you'll want to be using AS3.

Oh no, I'm an animation :) and am just doing this for fun. Thanks for the input tho. Btw can you help me with my problem? the second one, that I mentioned in my first reply.

Response to: Constantly fecrease health Posted December 26th, 2012 in Game Development

At 12/26/12 05:06 PM, egg82 wrote: I get the subtle impression that this is a porn game

at any rate, if you with to continue programming or are planning on building a game out of this (not just buttons or something) then it's very highly recommended that you forget AS2 and learn AS3.

Is there any reason you are bringing this up?

Hmm I'm using as2 because I didn't rly see why use as3. Is using as2 bad?

Response to: Constantly fecrease health Posted December 26th, 2012 in Game Development

Hey thanks!

I changed my code to:

if(body._currentframe == "1"){
	trace("Something is happening!");
		_root.pl-=random(10);
}

You were right! when I replaced the frame label with the frame number I got the output just fine. But only the "Something is happening!" output. "_root.pl-=random(10);" doesn't seem to have any effect on the health, this is weird because I have the following code connected to a button to test health decreasing and it works just fine:

testpl.onRelease=function(pleasure){
	_root.pl-=random(10);

}
Constantly fecrease health Posted December 26th, 2012 in Game Development

Hey I want to constantly decrease health if nothing is done and my frame code is:

if(body._currentframe == "idle"){
		_root.pl-=random(10);
}

So basically the idea is if animation idle for object "body" is played -> decrease health but nothing happens. Why?

Thanks