3 Replies Latest reply on Nov 13, 2010 6:10 AM by Ned Murphy

    My car game needs help (swf in post)


      I have a car that i control with the arrow keys and i want the car to shoot from the side when pressing space.
      I have an image of the muzle flash in png format that will appear on the same spot of the car even when i move car to the right or left etc.


      The scene is seen from above.


      And for some reason the first muzle flash is always slow when you hold down space.


      Here it is


      Please dont move the car while testing the shoot function at the same time.


      So it's the script I need help with.


      Sorry for my english.


      (will post fla if needed).

        • 1. Re: My car game needs help (swf in post)
          Ned Murphy Adobe Community Professional & MVP

          If you need help with the script for the muzzle flash, then you need to show the script related to it.  Be sure to indicate what the problem is that you are trying to fix.  Your first posting does not make it clear, so explain what should happen that currently does not.

          • 2. Re: My car game needs help (swf in post)
            antworker Level 1

            As you see now in the swf you can move the car and when you shoot, the muzzle flash is on the same spot or moves away from the car.

            I want the muzzle flash to follow the car whereever it moves.


            The script I use now is the same controls as for the car, when i press left key the car goes to the left etc, so I put the same code for the car controls to the muzzle flash movieclip. But since the muzle flash must be invisible all the time except for when space is pressed i got problems.

            I just added a simple gotoAndPlay(2); where the first frame of the muzleflash I moved it out of the scene and on the second frame I moved it to the side of the car. So when space is pressed it jumps to frame 2 where the muzleflash is visible.


            Hope it helped.

            • 3. Re: My car game needs help (swf in post)
              Ned Murphy Adobe Community Professional & MVP

              Have the muzzle flash as part of the car movieclip so that it moves with the car. Instead of moving it out of sight in frame 1, just don't have it in frame 1.  Alternatively, instead of having it as a two frame movieclip, you could just control its _visible property and avoid using a timeline command to make it change frames.  Sometimes a frame change can get delayed if there's alot going on, which might be what is happening when you say it is slow.