[AS3] Hit test and depth
hello there. i'm new to as3 code and creating games but i have a simple game in mind that i would like to create and it involves a simple "shooter" type of game where like, the mouse on the stage is moving a pistol or bb gun and like 15 feet away are some random appearing targets and when you press the left mouse, the pistol fires a bullet and if it hits one of the targets then a sound is played and the score is added up etc etc...
much of this i understand how to do but one thing i want to simulate is depth and gravity. from the guns perspective, the targets in the background will visually look like they are several feet away (15 or so) and i don't want the bullet to just travel in a straight line. based on the velocity of the bullet i want some gravity to "pull" the bullet down some when it's fired....making the game more difficult. and i only want the "hit" to count against the target when the bullet has reached the distance in order to actually hit the target. does this make sense?
i was wondering if anyone could show some example code to demonstrate this sort of thing in AS3. visually, my plan was to have it appear as though you were standing behind the shooter maybe a foot behind them. so my gun will end up being like a translucent gun that perhaps flashes real quick
|