Game Development Reference
In-Depth Information
Game Play
Aspect
Basic Optimization Principle
Background an-
imation
Minimize background areas that are animated so that the entire back-
ground looks animated but is not.
Game play logic Program game play logic (simulated or AI) to be as efficient as possible.
Scoreboard up-
dates
Update scoreboard only when scoring, and minimize score updates to once
per second maximum.
UI design
Use a static UI design so that pulse events are not used for UI element pos-
itioning or CSS3.
Considering all these game programming areas makes game programming an ex-
tremely tricky endeavor!
It is important to note that some of these aspects work together to create a given il-
lusion for the player. For instance, the sprite animation will create the illusion of a
character running, jumping, or flying, but without combining that code with sprite posi-
tioning (movement) code, the reality of the illusion will not be achieved. To fine-tune
an illusion, the speed of the animation (frame rate) and the distance moved (in pixels
per frame) may need to be adjusted (I like to call this tweaked) to get the most realistic
result. We will be doing this during Chapter 13 .
If you can move game elements (primary player sprite, objectile sprites, enemy
sprites, background) a greater number of pixels a fewer number of times, you will save
processing cycles. It is the moving part that takes processing time, not the distance
(how many pixels are moved). Similarly, with animation, the fewer frames needed to
achieve a convincing animation, the less memory will be required to hold those frames.
Remember that you are optimizing memory usage as well as processing cycles. Detect-
ing collisions is a major part of game programming logic; it is important not to check
for collisions between game elements that are not “in play” (on the screen), or active,
and that are not near each other.
Forces of nature (physics simulations) and game play logic if it is not well coded
(optimized), are the most processor intensive aspects. These are subjects I will cover
later in the topic, when you are more advanced (see Chapters 16 and 17 ) .
Game Design Concepts: Sprites, Physics,
Collision
Search WWH ::




Custom Search