Attached is a picture of the lasers (the yellow) coming out of a spaceship. The spaceship moves around like the asteroids spaceship, but the laser comes out to the side, can anyone tell me the correct actionscript to have the laser come out of the front, even as you turn? That would be terrific, thank you.
I am not game programmer nor do I have Flash 6 so I can’t help much, but heres a point in the right direction…
Whatever clip you are duplicating… put it inside your spaceship clip. That way it will be launched correct no matter what the ships rotation is. You will have to adjust the targeting to duplicate the clip and stuff of course.
Ill probably do that, but I want to see if people have the Asteroids actionscript… plus, If something hits the lasers, it should die, and if something hits the spaceship, YOU should die, so… If i put them in the same clip, wouldnt that just have one or the other?
See, theres is where my lack of game programming gets in the way.
The way I was thinking is your enemies each run the hitTest() to check for the laser clip inside the spaceship clip, and another hitTest() to check if the spaceship actually hits it.
But I have no idea how to go about doing that due to my lack of game coding experience.
But now that I think of it, I think macromedia.com had an asteroids type of game tutorial on their site somewhere.
Do i add that in to the laser’s script, or the spaceships? cause I put it on the spaceships, and the laser doesnt stay in front of the spaceship, it just rotates kind of.
I added it to the spaceship, and the same thing happens, although, the movement is a lot more like asteroids, and the thrust shows up only when UP is pressed. Where did you get this script?
Alright, does anyone have the code for the asteroids game, on the macromedia site, but for flash 5? I have all the rotations, and the movements of the craft down, but, I just dont have the code for the laser. I took one off my other game, in which the laser moves off to the left of the screen. Can anyone please help??