I'm creating a simple game but as you might have guessed it has alot of variables. My problem is when anyone of my variables hits a wall it does not stop moving.
this is my code on my main frame
Code:
_root.mb1 = false;
_root.mb2 = false;
_root.mb3 = false;
_root.mb4 = false;
_root.mb5 = false;
_root.mb6 = false;
_root.mb7 = false;
_root.mb8 = false;
_root.balls = new Array("b1","b2","b3","b4","b5","b6","b7","b8");
_root.team = new Array();
_root.team[0] = ["1p1","1p2","1p3","1p4","1p5","1p6","1p7","1p8","1p9","1p10","1p11","1p12"];
_root.team[1] = ["2p1","2p2","2p3","2p4","2p5","2p6","2p7","2p8","2p9","2p10","2p11","2p12"];
The names in the quotes are all the names of my movieclips on stage.
This is my code on my movieclip wall
Code:
onClipEvent(enterFrame){
for (i=1;i<_root.balls.length; i++){
if (_root.balls[i].hitTest(this)){
_root.mb . i = false;
}
}
for (i=1;i<_root.team[0].length; i++){
if (_root.team[0][i].hitTest(this)){
_root.team[0][i]._y -= _root.speed;
}
}
for (i=1;i<_root.team[1].length; i++){
if (_root.team[1][i].hitTest(this)){
_root.team[1][i]._y -= _root.speed;
}
}
}
Thank you so much