TGB/BasicTutorial1
From TDN
|
[edit] OverviewThe following links can take you to further sections of the tutorial: TGB Shooter Tutorial Part 1 - Importing Images
[edit] Tutorial Notes
[edit] Introduction
[edit] Getting Started
The Level Builder allows users to easily start new projects through a simple project creation
wizard. This gives designers a much more flexible approach to creating new projects, since the
Level Builder automatically creates all of the files a user needs to make a game. This section, of
the shooter tutorial, will help you work through the process of starting a brand new game project
from scratch.
[edit] Creating a Project
[edit] Importing Audio, Images, and Particle Effects
You can download the art and other assets for this project from this wiki. When you open the downloaded file, you'll see a data folder, with audio, images, and particles inside of it. We won't be using all of these resources, but they're available here for you to use to expand on the finished tutorial if you wish. Copy all of the images, audio, and particle effect files from inside of these folders into the respective folders inside of your shooter game's project folder at the path listed above. Go ahead and replace any existing files if asked.
Although we've now copied these images into the game folder, you won't see them show up in Torque Game Builder automatically; We need to specifically import each image that we'll be using, and tell TGB how exactly we want the image to be used. First, click on the Create a new ImageMap button: Once you click on this button, a dialog should appear asking you to select your image (on Mac OS X, the standard "open file" dialog will open) (as shown in Figure 1.7). The file browser should automatically navigate you to yourProjectName/data/images folder, but double-check to be sure.
First we need to import a ship for the player in an image named playerShip.png. Find that image in the list and click select (as shown in Figure 1.8). After creating an image map for the player's ship, you will see it show up in the Static Sprites section of the project library. The player's ship image is a single image. Torque Game Builder, can also handle multiple pieces, or frames, within the same image file. For example, when the player's ship is blown up, it breaks into several pieces. Find the image named "debrisPlayer.png". This image contains four frames of the player's ship broken into four pieces. Create an image map for this image as you did with the player's ship in one piece. In the Static Sprites section, double-click on the image map for the debris. The window that will pop up contains all of the settings which tell TGB how to interpret and use the image. Under Image Settings is a popup labeled "Image Mode". Click on this popup and change the value from FULL to CELL. The FULL image mode tells TGB that the image is one single frame. The CELL image mode tells TGB that there are multiple frames in the image, and that they are combined using a logical grid. In this particular image the image frames are square 128x128 cells, two across, and two high. After you select the CELL image mode, you'll see your image broken into four parts: After saving the changes to the image map, you will now see a little button tab under the image in the Static Sprites section of the project library. You can click on this button the flip through the different frames of the image.
Now that you know how to import images, import the following images using the FULL image mode:
And import the following images using the CELL image mode, adjusting the cell width and height values if necessary.
[edit] Reload the Project
After importing all of the images, select the "Reload Project" menu item from the "Project" menu. All of the particle effects that you copied into to the "particles" folder earlier, are automatically loaded by TGB, and now that you have created the necessary image maps for the images that the particle effects use, you'll see the particle effects in the Particle Effects section in the library. If you hover with the mouse over any of the effects, you'll see it animate.
Once you have all of your images imported, we can begin making our game world. |
Categories: T2D | TGB | GameExample | Tutorial













