Search Tutorials
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))
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|