15 Replies Latest reply on Jan 25, 2007 10:34 AM by kglad

    Problem with return true and if statement

    nemesis_256 Level 1
      I'm making a ship shooter game and I have a problem with the collision detection for the corners of the stage. When you hold down two of the arrows to move the ship into the corners of the screen, the ship will go past it. The function bellow is what I'm using to detect this collision. The reason I'm using a function is because it's used for the ship and for all the balls from the cannons (as shown in the last two lines of the attached code). This is the reason I need the return true, so the if statement can be evaluated to true and then unload the movieclip of the cannon ball. When I remove the return true, the collision works fine, but obviously my cannon balls all get stuck on the edges.

      Any ideas?