Alright, I was cruising along nicely with this until I got to the part where you add the code to make your ship die.
This code:
onClipEvent(enterFrame){
if (this._name == "player") {
*ALL THE CODE YOU TYPED PREVIOUSLY SHOULD BE HERE WITHIN THIS NEW SET OF CURLY BRACKETS*
}
}
I've been putting that code like this on my "player" movie clip:
onClipEvent(enterFrame){
if (this._name == "player") {
onClipEvent (enterFrame) {if (_x>_root.stagex) {
_x = _root.stagex;
}
if (_x<0) {
_x = 0;
}
if (_y>_root.stagey) {
_y = _root.stagey;
}
if (_y<0) {
_y = 0;
}if (Key.isDown(Key.SPACE)) {
if (nextshot == 0) {
nextshot = reload;
shotnum++;
_root.shot.duplicateMovieClip("shot"+shotnum, shotnum);
_root["shot"+shotnum]._x = this._x;
_root["shot"+shotnum]._y = this._y;
}
}
if (nextshot>0) {
nextshot--;
}
if (shotnum>=shotmax) {
shotnum = shotmin;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.UP)) {
_y -= speed;
}
if (Key.isDown(Key.DOWN)) {
_y += speed;
}
}
}
}
The bolded parts are the new code I put in.
I'm not sure how I'm misunderstanding it.
Oh, and here's my game. You might've noticed that the gunshot isn't firing at the center of the car. Well that's the way I want it, considering the dude's hand is leaning out the window. But the explosions for the enemies are way off. The enemy dissapears and the explosions pops up to far back and to the right.
Yes, I didn't make it space themed. It's called "breaking away from the norm", or something like that. I wanted to do something different than everyone else.