First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Flash Junkie | Website: http://www.flashkit.com

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!

Comments

  • 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: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.