Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-22-2002, 06:41 AM   #1
whitegriffin
Registered User
 
Join Date: Jan 2002
Posts: 29
Arrow game enemy movement

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
whitegriffin is offline   Reply With Quote
Old 01-22-2002, 08:18 AM   #2
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

....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?
__________________

komielan.com
red penguin is offline   Reply With Quote
Old 01-23-2002, 01:02 AM   #3
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Old 01-23-2002, 01:06 AM   #4
whitegriffin
Registered User
 
Join Date: Jan 2002
Posts: 29
Default

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
whitegriffin is offline   Reply With Quote
Old 01-23-2002, 01:22 AM   #5
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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;
}
The upper and lower variables define the top and bottom _y. You can make them random...
__________________
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.
Jesse is offline   Reply With Quote
Old 01-23-2002, 01:27 AM   #6
whitegriffin
Registered User
 
Join Date: Jan 2002
Posts: 29
Default

thanks a lot that worked perfect!
whitegriffin is offline   Reply With Quote
Old 01-23-2002, 01:32 AM   #7
red penguin
[^\d\D]
 
red penguin's Avatar
 
Join Date: Jun 2001
Location: Brooklyn, NY
Posts: 3,253
Default

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!
__________________

komielan.com

Last edited by red penguin; 01-23-2002 at 01:34 AM..
red penguin 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
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


All times are GMT. The time now is 11:27 AM.


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