hi all,
ive made a war game VERY simple. my problem is when i shoot them (mouse click) they play the die animation and then respawn. which is all good. BUT once respawned i cannot shoot them ?
heres my code (frame)
_root.onLoad = function() {
Mouse.hide();
_root.hit1._alpha = 0;
_root.hit2._alpha = 0;
_root.hit3._alpha = 0;
_root.hit4._alpha = 0;
_root.health = 100;
_root.kills = 0;
};
_root.onEnterFrame = function() {
_root.aimer._x = _root._xmouse;
_root.aimer._y = _root._ymouse;
_root.tank._x -= 1;
_root.hit2._x = _root.tank._x;
_root.japan_4._x = _root.tank._x;
if (_root.tank._x<=0) {
_root.tank._x = 650;
}
_root.hit1.onPress = function() {
if (_root.japan_1.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.japan_1.gotoAndStop("dead");
_root.kills += 1;
}
if (_root.japan_2.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.japan_2.gotoAndStop("dead");
_root.kills += 1;
}
if (_root.japan_3.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.japan_3.gotoAndStop("dead");
_root.kills += 1;
}
};
_root.hit2.onPress = function() {
if (_root.japan_4.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.japan_4.gotoAndStop("dead");
_root.kills += 1;
}
};
_root.hit3.onPress = function() {
if (_root.japan_5.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.japan_5.gotoAndStop("dead");
_root.kills += 1;
}
};
_root.hit4.onPress = function() {
if (_root.japan_6.hitTest(_root._xmouse, _root._ymouse, false)) {
_root.japan_6.gotoAndStop("dead");
_root.kills += 1;
}
};
if (_root.health <= 0) {
_root.gotoAndStop("japs win");
}
if (_root.kills >= 25) {
_root.gotoAndStop("youwin");
}
};
also its a bit confusing so heres the swf. Shoot all the enemys to make them respawn.
cheers,