Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Space Invaders Game

Status
Not open for further replies.

N64MARIO64

Technical User
Nov 17, 2002
11
US
Hi, I am working on a space invaders type game. I would like to know the code to make the x pos to move up and down when the up & down arrows keys are pressed. Thanks -mario
 
This would go on a movie clip:

Code:
onClipEvent(load){
	speed = 5;
}
onClipEvent (enterFrame) {
	(Key.isDown(key.DOWN))?(this._y+=speed):null;
	(Key.isDown(key.UP))?(this._y-=speed):null;
	updateAfterEvent();
}
 
What flash are you using? I am using 4. I cannot put codes on movie clips(or that i know of you can't) Can I just put it on the movie itself?
 
I am using Flash MX. I can't recall what the F4 syntax would be - it's been some time since I've used it.

Check flashkit.com if no one else posts. Here is one I found after a quick search


You can use that in conjunction with setProperty and that will hopefully get you rolling.
 
I don't know anything about Flash4 to, but I do know that in the beginning, I also had problems with where and how to put the code. Click once on a movieclip, and when its selected, then you should be able to type in the actions window. Greetz,
muppeteer.gif

themuppeteer@hotmail.com

Don't eat yellow snow...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top