Describing an object in the world
We have already added the level1.txt
file in the world
folder in Chapter 19, Game Programming Design Patterns – Starting the Space Invaders ++ Game. Let's discuss its uses, future intended uses, and its contents.
First, I would like to point out that a shooter game is not the best way to demonstrate how to describe a game world in a text file like this. The reason for this is that there are only a few types of game object and the most common one, invaders, are all lined up uniformly like soldiers on parade. They would actually be more efficiently described programmatically, perhaps in a nested for
loop. However, the intention of this project was to show the ideas, rather than learn how to make a Space Invaders clone.
Take a look at the following text, which is a sample from the level1.txt
file in the world
folder:
[START OBJECT] [NAME]invader[-NAME] [COMPONENT]Standard Graphics[-COMPONENT] [COMPONENT]Invader Update[-COMPONENT]...