PDA

View Full Version : I need help in scoring...



ar
January 14th, 2005, 06:22 PM
I need some help. I have this so far.

_root.score1 = 100
_root.score2 = 20

set as my background frame thing.
I have two text planes. One is score1 the other is score2.
I made a button that had this code.

on(release) {
score1 = score1 + 5
score2 = score2 - 5

All of that works perfectly, but then score2, once it reaches zero, it goes into negative.

How do I make it so that score2 doesn't go into a negative number?
Is this clear enough?

~ЯאַR~}{('~
January 14th, 2005, 06:30 PM
if score2 =< 0 then _root.score2 = 0 ¿?

ar
January 14th, 2005, 07:10 PM
if score2 =< 0 then _root.score2 = 0 ¿?
Where do I put that code? It doesn't work anywhere...

epoch
January 14th, 2005, 09:22 PM
on(release) {
if (_root.score2 > 0) {
score1 = score1 + 5
score2 = score2 - 5
}
}

~ЯאַR~}{('~
January 14th, 2005, 09:44 PM
Where do I put that code? It doesn't work anywhere...

Because is not the proper syntax, i dont know if this is right <= or =<

But it's simple, everytime that score2 reaches 0 you have to restart it's value to 0 to prevent it from dropping down.

I think it should be something like this:

if (score2 <= 0 ) {
_root.score2 = 0
}

~ЯאַR~}{('~
January 14th, 2005, 09:59 PM
Hey, That's better than what i suggested =P

if (score2 <= 0 ) {
_root.score2 = 0
}

(and i dunno if i am right x.x)

senocular
January 14th, 2005, 10:05 PM
Threads merged
please keep your questions to a single forum. Thanks :)

ar
January 14th, 2005, 10:07 PM
IT WORKS!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!

~ЯאַR~}{('~
January 14th, 2005, 10:17 PM
IT WORKS!!!...!!!...

my suggestion or the suggestion in the other post?

ar
January 14th, 2005, 10:26 PM
I'm sorry people... I'm just losing my touch.

How do I make this work?

If (_root.score2 = 0)
gotoAndPlay(2);
{

ar
January 14th, 2005, 10:28 PM
epoch's worked.

~ЯאַR~}{('~
January 14th, 2005, 10:37 PM
I'm sorry people... I'm just losing my touch.

How do I make this work?

If (_root.score2 = 0)
gotoAndPlay(2);
{

If (_root.score2 = 0) {
gotoAndPlay(2);
{ blah blah blah
}
}

signifer123
January 15th, 2005, 04:05 PM
Actually this is faulty too :P


If (_root.score2 = 0) {
gotoAndPlay(2);
{ blah blah blah
}
}
it would be


If (_root.score2 == 0) {
gotoAndPlay(2);
{ blah blah blah
}
}

ar
January 15th, 2005, 04:19 PM
none of these are working. how do I make it to "if this happens, then this happens" sort of thing. If score2 = 0, then this thing appears.

icio
January 15th, 2005, 07:36 PM
if (_root.score2 == 0) {
_root.gotoAndPlay(2);
}

??

ar
January 15th, 2005, 08:58 PM
it's still not working.




Here's the project file.
It's just the button thing.

JoMan
January 15th, 2005, 10:25 PM
Here is an fla of what I think you are trying to do:

P.S. all that you need to know is on this thread.

ar
January 15th, 2005, 10:48 PM
in that fla that I attached, do you thing that you could do that sort of thing, as in if the score2 goes to or below 0 then a little thing pops up.

JoMan
January 16th, 2005, 12:00 AM
You should be able to do that with the fla that I posted. You just need to rearrange the code so that it reacts the way that you want it to.

ar
January 16th, 2005, 03:42 PM
this isn't working. I have this for a button:

on (release) {
if (_root.score2 = 0) {
gotoAndStop(2);
}
}

but one problem, instead of going to the next frame, it makes score2 equal 0, and stays at that frame. I want the button to work, so that if score2 IS ONLY 0, then on (release) it would go to and stop on frame 2.

ar
January 16th, 2005, 03:47 PM
never mind. I figured out the problem I was supposed to make it say:

...
if (_root.score2 <= 0)
...

The one little < thing changed the whole thing! That's awesom...

another problem... how do I make something invisible on the frame, but when score2 = 0, then it pops up, without me having to go to the next frame?

JoMan
January 16th, 2005, 04:14 PM
First give it a '_visible = false' code, then when score is at a certain number, the code will be '_visible = true'.

peace

ar
January 16th, 2005, 04:23 PM
I tried putting this:

if (_root.score2 > 0) {
_visible = false

but it says that that it's not within the handler, how do I make it work?
Where do I put _visible = false?
Where is my MOMMMYY!!!!!!!!!!!!! WHAH!!!!!!!!!!!

RyxiaN
January 17th, 2005, 03:11 PM
What is it for game you are making? And RPG?

ar
January 17th, 2005, 03:32 PM
yeah, RPG's

ar
January 17th, 2005, 04:01 PM
I still can't get the simple popup thing to work. I made an image, tried to make it nonvisible when that frame starts up, but I can't get the coding right. Any suggestions?

RyxiaN
January 18th, 2005, 12:48 PM
Can you show me your game?

e-sarbak
January 18th, 2005, 12:52 PM
this = and == thing always annoys me

ar
January 18th, 2005, 04:41 PM
I'm still in the process of making it... so no one can see it right now. I'm working on a gundam wing rpg. People are going to be able to live as the different characters, and they're going to play through the actual storyline of the series... It's going to take a while to correctly make my rpg match the series perfectly.


Yeah, I'm stuck on the = and == things, it's hard to make everything work, especially since all of the codes have to come from memory when you're making a game.

ar
January 18th, 2005, 05:58 PM
this is driving me nuts... how do I make something invisible when the frame loads up!