- blog (13)
- game development (61)
- Games (9)
- games related (9)
- MS Office (7)
- PHP (3)
- Tutorial (8)
- Intermediate (1)
- Tutorial Series (15)
- Uncategorized (1)
Tag Archives: node
In this part of the terrain modification tutorial I will show you how to move single nodes and their neighbors if necessary. To begin at a smaller scale I will not use a multi-row grid but a line of nodes instead.
Every node in a line will have two neighbors (except for the outer ones of course).
I know this may look like a call to clone. But the intention of this post is more like look and learn. Once you can do the same, make it better. We’ll have a look at Desktop Tower Defence and try to understand the basic methods of that game.
This post will cover the creation of the square grid in different colors and a method to obtain the actual position to build a tower.
In this part the adjacent cells of the acual node are called. This can get handy if we want to implement some kind of pathfinding algorithm. The base for this code is part 2.2. See part 1 for the creation of the basic grid.
Now it’s time to add some interaction to the grid made in part 1. For that purpose simple MouseEvents for movement and click will be sufficient. As indication we will change the color of the relevant tile.
There are a lot of games based on different kinds of grids: Real Time Strategy (RTS) or round based Role Play Games (RPG) and Tower Defence (TD) games as well as Top-Down-Shooters and vertical scrolling Jump&Runs. One could use grids for tactical board games as well.
In the grid we are going to create, each tile consists of two parts, an Object() for the node and a MovieClip() for the graphic. The presented code is timeline and can thus be copied into the actions panel. This way it can be used for practicing purposes fast. For a game I would rather create and sort the code in classes.