import flash.events.KeyboardEvent;
import flash.events.Event;
import flash.display.MovieClip;
//initializes variables.
var speed:int = 5;
var key_left:Boolean = false;
var key_right:Boolean = false;
var key_up:Boolean = false;
var key_down:Boolean = false;
//Checks if the player presses a key.
stage.addEventListener(KeyboardEvent.KEY_DOWN,KeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP,KeyUp);
//Lets the function main play every frame.
addEventListener(Event.ENTER_FRAME,Main);
//create the function main.
function Main(event:Event){
CheckKeys();
}
//create the function KeyDown.
function KeyDown(event:KeyboardEvent){
if(event.keyCode == 37){ //checks if left arrowkey is pressed.
key_left = true;
}
if(event.keyCode == 39){ //checks if right arrowkey is pressed.
key_right = true;
}
if(event.keyCode == 38){ //checks if up arrowkey is pressed.
key_up = true;
}
if(event.keyCode == 40){ //checks if down arrowkey is pressed.
key_down = true;
}
}
when i shoot the enemies, some of them dont even get affected, but when i shoot some of the others, they get shot. Can someone plzhelp? I literally copied the code into all my files, annd nothing got affected. Plz help!!!
@ Vidy
Yeah, ill fix that in the full game. I just decided to keep level 4 "impossible" at the moment. Sorry about that, im just a beginner, its my second game.
great game! THe game has really evolved from Epic Battle FAntasy 1! You have the save feature, and you made it an rpg where you can move and interact with others. Good job! 5/5!