ImprisonedPride
03-13-2006, 07:00 PM
Ok now let me say I'm farthest from a good programmer, but I've been teaching myself Flash MX from the ground up but I've come upon a slight hitch.
I'm creating a basic shooter, ship centered, rotates to mouse angle etc etc. I'm trying a few easy games before I start creating what I want to really create, but I digress.
The problem I'm having is this. In the clip, there is 2 frames. The first frame does something like this (not at home or I'd just paste the code):
Code:
onMouseDown
X++
duplicateMovieClip("bullet_new","bullet_new" add x, x)
In the first fram that part works fine, it creates a new bullet clip and increments the name 1 every time so it doesn't create similarily named instances. Anyhow, the problem I'm having is this. I pasted some action script from a tutorial to learn from and rewrite as my own, but the way their tutorial works, the bullet slows down as it approaches the mouse click x and y. When it reaches where the mouse was clicked it stops! What I preferred was to just have the bullet continue until it left the screen, and then remove itself once off the screen to keep the load light on the pc so the game runs smoother. I was making progress using Math.atan, but I haven't been able to figure out how to increment the bullet_newx's x and y value to have it just continue in that angle, and delete itself once off screen.
Oh and the code to do this is in the second frame, but I've noticed with the tutorial code that I pasted, I needed to have a copy of the original bullet_new in BOTH frames with the actionscript inside of each one so that it keeps updating. Sorry, I'm really new to this but I really want to learn it. Thanks for your time.
Any suggestions are welcome and appreciated.
Marc
I'm creating a basic shooter, ship centered, rotates to mouse angle etc etc. I'm trying a few easy games before I start creating what I want to really create, but I digress.
The problem I'm having is this. In the clip, there is 2 frames. The first frame does something like this (not at home or I'd just paste the code):
Code:
onMouseDown
X++
duplicateMovieClip("bullet_new","bullet_new" add x, x)
In the first fram that part works fine, it creates a new bullet clip and increments the name 1 every time so it doesn't create similarily named instances. Anyhow, the problem I'm having is this. I pasted some action script from a tutorial to learn from and rewrite as my own, but the way their tutorial works, the bullet slows down as it approaches the mouse click x and y. When it reaches where the mouse was clicked it stops! What I preferred was to just have the bullet continue until it left the screen, and then remove itself once off the screen to keep the load light on the pc so the game runs smoother. I was making progress using Math.atan, but I haven't been able to figure out how to increment the bullet_newx's x and y value to have it just continue in that angle, and delete itself once off screen.
Oh and the code to do this is in the second frame, but I've noticed with the tutorial code that I pasted, I needed to have a copy of the original bullet_new in BOTH frames with the actionscript inside of each one so that it keeps updating. Sorry, I'm really new to this but I really want to learn it. Thanks for your time.
Any suggestions are welcome and appreciated.
Marc