First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Flash Junkie | Website:

Tracking the Laser Shot

The laser shot moves itself across the screen from its starting point, using the (xmov) and (ymov) variables that the gun set in it when it was created. In this case, there is no collision checking at all. (The next tutorial "Laser Collision Checking" will deal with this)

The laser shot will cease to exist once it moves off the screen. You do this to keep the amount of moving objects as few as possible. Remove everything as soon as you can and your game will run more smoothly. In this case, we enter some actual numbers (the movie is 350x650 pixels .... see Modify > Movie in the Flash menubar. If you chance your movie size, be sure to reflect that here in these numbers.

The Laser Shot asks "Where am I?"

Set Variable: "my_x" = GetProperty("",_x)
Set Variable: "my_y" = GetProperty("",_y)

The Laser Shot asks "Am I off the screen?"

If (my_y>(350) or my_y<(0) or my_x>(650) or my_x<(0))
» Level Advanced

Added: 2000-05-15
Rating: 6 Votes: 175
(10 being the highest)
» Author
Flashjunkie is a self-professed obsessive addict of life. Due to the highly artistic nature required of an Art Director for an Ad agency, he took up Flash to add some math to his diet.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.