Game Development Reference
In-Depth Information
Drawing lines and shapes
The second most useful thing to draw to the screen is a line or a shape. This allows you to
see things that aren't naturally visible to the player via a sprite or background.
A common use of drawing a shape is when you see a circle around an object showing the
range of that certain object. This is common in tower defense games. In GameMaker, we
can do the exact same thing by using the draw_circle function and a range variable to
set the circle's radius.
Circles, rectangles, and other shapes can also be used to draw basic objects. For example, if
we were making a system for later use and didn't want to use sprites, we could just use the
draw functions to show basic representations on the screen.
Lines can be used to show where a player is aiming. For example, when the mouse is used
to aim a gun, you can draw a line from the gun to the mouse to act like a laser. This allows
the player to be more accurate with their shooting.
Search WWH ::




Custom Search