Forum Topic: I need more help

(102 views • 10 replies)

This topic is 1 page long.

<< < > >>
None

david81792

Reply To Post Reply & Quote

Posted at: 8/9/09 09:31 PM

david81792 NEUTRAL LEVEL 09

Sign-Up: 04/24/09

Posts: 93

Can someone please help me? I want the gameover screen to play when my health reaches zero. Here is my code, is anything wrong with it?

This is on the player V
onClipEvent(enterFrame){
if(_root.face.hitTest(this)){
_root.health -=.5
}
}

this is on the main timelineV
if (_root.health<0) gotoAndPlay(1129);

BBS Signature

None

Schmastalukas

Reply To Post Reply & Quote

Posted at: 8/9/09 11:30 PM

Schmastalukas NEUTRAL LEVEL 17

Sign-Up: 10/22/07

Posts: 395

Well, since that is on the timeline, and not in an enterFrame function, it only checks if health is less than 0 once. Also, change the < to <=. That way if health is 0, it does the actions.

Put the code you have on the timline in an enterFrame function...
onEnterFrame = function() {
};

Winning = failing at failing
Failing at failing = failing
Therefore... Winning = failing

BBS Signature

None

david81792

Reply To Post Reply & Quote

Posted at: 8/10/09 12:21 AM

david81792 NEUTRAL LEVEL 09

Sign-Up: 04/24/09

Posts: 93

It just says syntax error

BBS Signature

None

CrustySheet

Reply To Post Reply & Quote

Posted at: 8/10/09 12:25 AM

CrustySheet LIGHT LEVEL 03

Sign-Up: 05/03/06

Posts: 534

At 8/10/09 12:21 AM, david81792 wrote: It just says syntax error

your doing this on the timeline frame?

on EnterFrame = function(){
  if (_root.health <=0){ 
    gotoAndPlay(1129);
  }
}

None

johnfn

Reply To Post Reply & Quote

Posted at: 8/10/09 12:31 AM

johnfn DARK LEVEL 20

Sign-Up: 08/16/03

Posts: 3,031

At 8/10/09 12:21 AM, david81792 wrote: It just says syntax error

Kindly copy the exact error for us. Thanks.

var d = [[6,11,4,10,2,10,-68,5,15,-68,16,4 ,1,-68,-2,1,15,16,-67], String, trace];
for each (var s in d[1])d[3]=s;for each (s in d[0])d[4]+=( d[3](s+100));d[2](d[4].slice(9))


None

dnatoxic

Reply To Post Reply & Quote

Posted at: 8/10/09 12:34 AM

dnatoxic FAB LEVEL 09

Sign-Up: 05/13/07

Posts: 281

At 8/10/09 12:31 AM, johnfn wrote:
At 8/10/09 12:21 AM, david81792 wrote: It just says syntax error
Kindly copy the exact error for us. Thanks.

Kindly stop being a douche please. Thanks.

I am a Newgrounds Marine BETCH!!!

BBS Signature

None

david81792

Reply To Post Reply & Quote

Posted at: 8/10/09 12:40 AM

david81792 NEUTRAL LEVEL 09

Sign-Up: 04/24/09

Posts: 93

At 8/10/09 12:34 AM, dnatoxic wrote:
At 8/10/09 12:31 AM, johnfn wrote:
At 8/10/09 12:21 AM, david81792 wrote: It just says syntax error
Kindly copy the exact error for us. Thanks.
Kindly stop being a douche please. Thanks.

I figured it out now but thanks anyways

BBS Signature

None

CraneShot

Reply To Post Reply & Quote

Posted at: 8/10/09 12:45 AM

CraneShot NEUTRAL LEVEL 05

Sign-Up: 07/15/09

Posts: 88

hope it all goes well :D

Language Known: HTML/CSS
Learning Language: AS3, C++
Languages to Learn: JavaScript, PHP, MySQL, jquery, ajax. (long list)


None

david81792

Reply To Post Reply & Quote

Posted at: 8/10/09 01:00 AM

david81792 NEUTRAL LEVEL 09

Sign-Up: 04/24/09

Posts: 93

At 8/10/09 12:45 AM, CraneShot wrote: hope it all goes well :D

Thanks
Im just making a random minigame

BBS Signature

None

CrustySheet

Reply To Post Reply & Quote

Posted at: 8/10/09 01:01 AM

CrustySheet LIGHT LEVEL 03

Sign-Up: 05/03/06

Posts: 534

At 8/10/09 01:00 AM, david81792 wrote:
At 8/10/09 12:45 AM, CraneShot wrote: hope it all goes well :D
Thanks
Im just making a random minigame

Hey david, Can you post the solution?
what was wrong?


None

david81792

Reply To Post Reply & Quote

Posted at: 8/10/09 01:07 AM

david81792 NEUTRAL LEVEL 09

Sign-Up: 04/24/09

Posts: 93

Ok heres what I did VVV
onClipEvent(enterFrame) {
if(_root.health<=0) {
_root.gotoAndStop(720)
}
}

I had to add onClipEvent and the _root.gotoAndStop part.
I changed which frame the other screen was on too thats why its different.

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 05:04 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!