| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jan 2002
Posts: 29
|
i have this game that i mad but i want the "bad gus" in the game, when crossing acrcoss the screen have an up and down motion i tried editing the movie clip but i need some action script to say wehn enter ___x cord play frame label _____ ill attach the fla file cause i got some weid scripting soo here it is:
game |
|
|
|
|
|
#2 |
|
[^\d\D]
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
|
....fla....too...large....to....DL......
you say you want random y movement from a clip moving from left to right? Is this what I understand? |
|
|
|
|
|
|
|
|
#3 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
As far as I hear it you've got the movement going but you want to be able to check if the object is yet at a set _x. Is that right? That's a simple getProperty loop...
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#4 |
|
Registered User
Join Date: Jan 2002
Posts: 29
|
ok so i got these enemys that scroll across the screen but they olny can move in a straight line along the x cord i want it so they still move along the x cord but i want them to have an up and down mothion when the enter the screen (making it a little harder
|
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
OK here's some code I threw together to make an MC move up or down:
Code:
onClipEvent (load) {
this.upper = 180;
this.lower = 280;
this._y = (upper+lower)/2;
this.yDir = random(10)>5 ? 1 : -1;
}
onClipEvent (enterFrame) {
if (upper>this._y) {
this.yDir = 1;
} else if (lower<this._y) {
this.yDir = -1;
}
this._y += 4*this.yDir;
}
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Jan 2002
Posts: 29
|
thanks a lot that worked perfect!
|
|
|
|
|
|
#7 |
|
[^\d\D]
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
|
Beat to the punch by the master himself....
mr. smarty pants...putting something like that in this forum without explanation...isn't that a violation of the rules? heheh it's a hoke, a hoke I say! Last edited by red penguin; 01-23-2002 at 01:34 AM.. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems with movement code for a game | Doccie | ActionScript 1.0 (and below) | 5 | 02-20-2005 07:59 PM |
| Enemy won't die | SecretAgentRege | ActionScript 1.0 (and below) | 1 | 07-28-2004 11:10 PM |
| [AS2] Tile game or not tile game? | krolben | Gaming and Game Development | 4 | 07-28-2004 01:41 PM |
| Game movement | MadWilson | Gaming and Game Development | 3 | 05-16-2003 03:35 PM |
| help with movement scripts for game | McGiver | Gaming and Game Development | 9 | 04-03-2003 05:01 PM |