Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-08-2007, 02:24 PM   #1
magjac
Registered User
 
Join Date: Mar 2007
Posts: 46
Default [AS2] Raise the flag game in Track and Field style

Hi guys

I need your help. I am trying to make this game where you bash two keys (right and left arrow) to raise a flag, like Track and Field. If you press the keys correctly the flag goes up if you press them incorrectly it goes down. But now I´m stuck, I can´t manage to get the flag moving. Could someone please help?
Attached Files
File Type: zip TracknField.fla.zip (10.7 KB, 122 views)
magjac is offline   Reply With Quote
Old 04-09-2007, 08:38 AM   #2
magjac
Registered User
 
Join Date: Mar 2007
Posts: 46
Default

Ok I figured out how to move the flag upwards. It now react to the amount of speed.

Here is what I added to the "flag" movieclip:

onClipEvent(enterFrame){
if (_root.speed>20){
_x += 0;
_y -= .2;
}
if (_root.speed>40){
_x += 0;
_y -= .5;
}

}

How do I get it to go downwards when there is no speed, or less then a specified amount. Without it going downwards att the begining of the game?
magjac is offline   Reply With Quote
Old 04-09-2007, 08:47 AM   #3
Ryzee
Registered User
 
Join Date: May 2006
Posts: 49
Default

if (_root.speed<5){
_x += 0;
_y += .5;
}
Ryzee is offline   Reply With Quote
Old 04-09-2007, 09:06 AM   #4
magjac
Registered User
 
Join Date: Mar 2007
Posts: 46
Default

Thanx Ryzee, but I have already tried that one, and the problem is that this code send the flag downwards before you start bashing the buttons. Any idea on how to correct this?
magjac is offline   Reply With Quote
Old 04-09-2007, 09:11 AM   #5
Ryzee
Registered User
 
Join Date: May 2006
Posts: 49
Default

make the downward function activate on a true statement which starts on false but is activated to true on the first button push...
Ryzee is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Track 'n' Field type powerbar. How? mrdogcat ActionScript 1.0 (and below) 1 07-16-2004 10:03 PM
track and field style controls reedy2k ActionScript 1.0 (and below) 2 09-22-2003 02:07 PM


All times are GMT. The time now is 07:14 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.