ajk62089
02-28-2009, 07:58 PM
Hello. Im looking to add new weapons to my games. Im not sure how to make it so that it replaces the current bullet movieclip so im making it an ammo type. I would like to make it so that everytime you hit 1,2,3,etc, that it will shoot based on the number you pushed. I noticed that it didnt include any numbers or letters with keydown so i was wondering what the script would be.
if (Key.isDown(Key.(I want this to be 1)) {
i++;
if (timer>=5) {
_root.attachMovie("Bullet1","Bullet1"+i,_root.getNextHighestDepth());
_root["Bullet1"+i]._x = Ship._x+3;
_root["Bullet1"+i]._y = Ship._y;
timer = 0;// Restarts the timer at 0.
}
}
if (Key.isDown(Key.(I want this to be 1)) {
i++;
if (timer>=5) {
_root.attachMovie("Bullet1","Bullet1"+i,_root.getNextHighestDepth());
_root["Bullet1"+i]._x = Ship._x+3;
_root["Bullet1"+i]._y = Ship._y;
timer = 0;// Restarts the timer at 0.
}
}