USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 8/9/09 09:31 PM
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);
Posted at: 8/9/09 11:30 PM
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
Posted at: 8/10/09 12:21 AM
It just says syntax error
Posted at: 8/10/09 12:25 AM
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); } }
Posted at: 8/10/09 12:31 AM
Sign-Up: 08/16/03
Posts: 3,031
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))
Posted at: 8/10/09 12:34 AM
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 errorKindly copy the exact error for us. Thanks.
Kindly stop being a douche please. Thanks.
I am a Newgrounds Marine BETCH!!!
Posted at: 8/10/09 12:40 AM
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 errorKindly copy the exact error for us. Thanks.Kindly stop being a douche please. Thanks.
I figured it out now but thanks anyways
Posted at: 8/10/09 12:45 AM
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)
Posted at: 8/10/09 01:00 AM
At 8/10/09 12:45 AM, CraneShot wrote: hope it all goes well :D
Thanks Im just making a random minigame
Posted at: 8/10/09 01:01 AM
At 8/10/09 01:00 AM, david81792 wrote: At 8/10/09 12:45 AM, CraneShot wrote: hope it all goes well :DThanks Im just making a random minigame
Hey david, Can you post the solution? what was wrong?
Posted at: 8/10/09 01:07 AM
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.
All times are Eastern Standard Time (GMT -5) | Current Time: 05:04 AM
<< Back