Game Development Reference
In-Depth Information
Procedural Programming
Many earlier programming languages, such as BASIC or Pascal,
were what are known as procedural languages. You can think of
them in the abstract as programming a list of tasks or subroutines.
They can be executed in any order, but all the commands are dri-
ven by one main logic controller, sometimes referred to as the
Theexamplesinthisbookwillbeacombinationof
procedural programming techniques and the next kind, object-
oriented programming.
main loop.
Object-Oriented Programming (OOP)
Unlike procedural programming, where the focus is on a set of
tasks to be executed, OOP is centered around the concept of
interactingwitheachother.OOPcanbeaverycompli-
cated subject to understand fully,butsufficeittosaythateach
object is a self-contained entity that has defining properties, can
send and receive messages from other objects, and can process its
own internal logic. For example, in OOP, a person would be one
object and his or her friend another. The persons will share some
components, both being people, but they will also have characteris-
tics unique to themselves. They communicate to each other
through messages in a common language. Some of the aspects of
ActionScript work in an OOP manner, and I will cover those at
length later on in this topic.
objects
Design Patterns
Much is talked about these days with regard to design patterns in
software engineering. There are many lengthy explanations, with
whole topics devoted to the subject in abstract. For the purposes of
this topic, think of a design pattern as the template for your code. It
is the blueprint by which you can structure a game as you program
it, particularly from an object-oriented approach. There are many
accepted design patterns in the industry, some of which work well
for Flash game development, and some that don
'
t really have a
place here. In Chapter 5, I
'
ll discuss the most effective patterns I
'
ve
found when working in Flash and how to implement them.
Classes
In OOP, classes are pieces of code that act as the building blocks of
objects. You can think of them as templates from which all the
objects used in an application are derived. A class defines all the
properties and functions (known as methods)ofanobject.Using
classes in Flash is important for a number of reasons. First of all,
defining your code in classes requires you to put more planning
Search Nedrilad ::




Custom Search