Game Development Reference
In-Depth Information
3.1 Shooting
Shooting mechanic is very common in 2D and 3D games. In this section we are going to
discuss a simple projectile that moves forward with constant speed. This means that we are
not going to discuss any external effects on the projectile such as gravity. Additionally, high
speed projectiles such as rifle and shotgun bullets are not going to be covered, since they
need a different technique that we are going to discuss later on.
Let's begin with a simple game that is similar to the classic game Space Invaders . We are
going to build a simple space shuttle like in Illustration 30, and then we should add a script
to control this shuttle. We are going to be able to move the shuttle in the four directions
and shoot two different types of projectiles: bullets and rockets, which have similarities
and dissimilarities. Since we are dealing with a top-down view, movement of the shuttle is
going to be on the x and z axes. This time we should change the perspective of the camera
to orthogonal, so the whole scene gets rendered in two dimensions, so the cubes look like
rectangles.
Search WWH ::




Custom Search