Build a Paintball Game (part 6 of 6)

Tagged:

Previous: "Speech" (part 5 of 6)

Editing Terrain

One other interesting thing you can do with StarLogo TNG is edit the "terrain." The landscape need not be a flat green square; you can add craters, mounds, plateaus and colors. To edit the terrain, click on the Edit Terrain button at the bottom of Spaceland. This will take you into terrain editor mode.Notice that a grid is shown and when you mouse over the terrain, you can see the x and y coordinates of each patch.

Mousing over each of the tools will give you a short description of what the tool does. There are four tools for changing the shape of terrain. These tools build a hill, build a wall (or platform), dig a wall, and build a crater. To use these tools, first drag out a rectangular area of the terrain.Then click on a tool to see its effect on the area you selected.

These tools can be combined with colors that you select with the Color button.

You can control the height of the hills or depth of the craters with the mouse wheel or by clicking on the buttons multiple times. 

If you want to reset the height of a patch to 0, click on the top left button.

When you are done editing your terrain just click the Edit Terrain button again.

When you view your terrain in StarLogo TNG you should see the mounds and craters that you built. Note that all agents glide along the surface of the world by default, staying at their current "height above (or below) ground". Consequently, if you launch a sphere from one side of a crater, over the crater, it will come down into the crater and then come back up on the other side. It is possible to have more "realistic" interactions, but you'll have to experiment with that by programming the kind of motion you want.

Other things you might want to try is to add a scoring feature. There is a built-in score variable in the Setup and Run tab. Another thing to try is to program the paintballs to "die" when they hit the edge of the world. Currently, they would just bounce off the edge and keep going until they hit a turtle. You may also want to experiment with making the motion of the paintball more realistic.


Back To Top