Session #4
The session dealt with implementing a tile-based editor for a platform game. The platform game was actually from a CS230 course at Digipen. This is a screen shot of that game:
The game in action The data file used ![]()
Width 20 Height 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 4 3 0 0 0 0 0 4 0 3 0 0 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 0 0 2 0 1 1 1 1 0 0 0 4 0 0 0 3 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 0 0 1 0 0 0 3 4 0 0 4 0 0 0 4 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 4 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 3 4 0 0 0 0 0 0 4 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
During the first few minutes, we talked about some of the features that one would want to have in a basic tile editor. This tool is by no means complete, but it is a good starting point. The primary focus of this lecture was to introduce the drawing grid components (TDrawGrid and TStringGrid). These components are very powerful and can bring a lot of power with minimal cost.
This is a very small program that just demonstrates some of the properties of the TDrawGrid and TStringGrid components. You should look at the properties in the Object Inspector in the IDE. Modify some of them and see how it changes the behavior. Specifically, modify these properties:
The draw grid The string grid ![]()
![]()
This is the "platform editor" that was presented for the rest of the session:
The empty editor The completed "level" ![]()
![]()
Be sure to read the comments in the .cpp file. They should explain most of what is going on.