PDA

View Full Version : [AS2] First Person shooter troubles


Theone3150
09-01-2008, 04:32 PM
I'm working on a first person shooter but my problem is that the enemy's can't die, you can and the guns bullets aren't working I mean the clip empties and it reloads but they don't deal the damage they are supposed to deal and if its like a rail shooter how would I get it to move to the next area (in an interesting way not coding)

ScionOfWar
09-03-2008, 02:14 AM
I don't know exactly what you mean by this, but I'm assuming you want the bullets to work on the enemy. Do you have a hitTest code attached to your enemy unit?

Here's a suggestion, that may fix your problem (unless you already did this). Click on your enemy icon in the library so you open it into editing mode. Add a couple of keyframes to your enemy, and make them so the enemy dissappears and whatnot. Then go to Frame 1 of your enemy symbol, select the keyframe and put in the code 'stop();', do the same to your last frame.

Go out of symbol editing mode and select your enemy piece on the stage, and add this code. You may need to change the 'player' variable to whatever is hitting your unit:

onClipEvent (enterFrame) {

if (this.hitTest(_root.player)) {
this.Play ();
}

I know this is pretty basic but I'm just trying to help :)