# Need help on my actionscript game

**URL:** <https://forum.kirupa.com/t/need-help-on-my-actionscript-game/246141>\
**Category:** Uncategorized\
**Created:** [December 7, 2007, 2:15pm UTC](https://forum.kirupa.com/t/need-help-on-my-actionscript-game/246141 "2007-12-07T14:15:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kai361](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@kai361](https://forum.kirupa.com/u/kai361)\
**Post date:** [December 7, 2007, 2:15pm UTC](https://forum.kirupa.com/t/need-help-on-my-actionscript-game/246141/1 "2007-12-07T14:15:25Z")

</div>

I am currently in my 2nd year at uni and I have to make a game in flash using action script, I hav decided to make a space invaders type game and I am using grinch’s in stead of space ships, I have nearly completed the game apart from one part. I need the game to take the user to the game over screen when the grinch’s y coordinates are at 560, the problem that I am facing is that as soon as I start the game the user is taken to the game over screen, is there anyone that can help me? The code that I have used for this is below in bold. Thankyou to anyone who can help me. I have also included the fla file as well, the code below is in scene 2, in the controller (the black circle to the left of the canvas.

// set the initial speed of the grinchs  
onClipEvent (load) {  
dropdown = false;  
speed = 10;  
}  
// move the grinchs  
onClipEvent (enterFrame) {  
for (i=0; i\<3; i++) {  
for (j=0; j\<10; j++) {  
// move horizontal  
_root[“grinch”+i+"_"+j].\_x += speed;  
if (_root[“grinch”+i+"_"+j].\_x\<0) {  
// set direction to right  
speed = 10;  
// drop down  
dropdown = true;  
break;  
}  
if (_root[“grinch”+i+"_"+j].\_x\>Stage.width) {  
// set direction to left  
speed = -10;  
// drop down  
dropdown = true;  
break;  
}  
\*\* //sends to game over\*\*  
\*\* if (_root[“grinch”+i+"_"+j].\_y\>=560) {\*\*  
\*\* trace(“game over”);\*\*  
\*\* \_root.gotoAndPlay(“gameOver”);\*\*  
\*\* }\*\*  
}  
}  
// end for loops  
// drop down all the rows  
if (dropdown) {  
for (var i = 0; i\<3; i++) {  
for (var j = 0; j\<10; j++) {  
_root[“grinch”+i+"_"+j].\_y += 20;  
}  
}  
}  
dropdown = false;  
}
