I have a platform game, where you can move side to side, and jump.
When you push CONTROL, your character fires a bullet that goes EAST, and only east.
(or right if you dont know directions)
(the bullet is actually a clip, and when it hits an enemy, its takes the enemy to the second frame within themselves.)
Here is the actionscript I have for the bullet:
onClipEvent (load) {
laserMoveSpeed=20;
this._x=_root.character._x+57;
this._y=_root.character._y-48;
}
onClipEvent (enterFrame) {
if (this._name<>“laser”){
this._x+=laserMoveSpeed;
if (this._x>550){
_root.character.laserCounter–;
this.removeMovieClip();
}
if (this.hitTest( _root[“enemy”])){
_root.score+=10;
_root[“enemy”].gotoAndPlay( 2 );
}
}
}
Is there a way you could make it so, if you push right, your character faces right, and fires right.
But if you push left, your character faces left, and fires left.
Ive been trying to get this for a while… Is it something like
Make 4 keyframes within the character.
- Facing right
- Firing right
- Facing left
- Firing left
The actionscript I have for JUST standing right, and JUST firing right, is:
if (Key.isDown(Key.CONTROL) and (laserCounter<=maxLasers)) {
laserCounter++;
_root.laser.duplicateMovieClip( “laser”+depthCounter, depthCounter );
_root[“laser”+depthCounter]._visible=true;
depthCounter++;
if (depthCounter>maxLasers){
depthCounter=1;
}
}
}
If you dont want to help, I understand. Its a very complicated question…