ITGB/Tutorials/SimulatorTest2

From TDN

Image:Alert.png This article or section needs updating.

Parts of this article or section have been identified as out of date.
While the information may be useful, be advised that it may be inaccurate, buggy or erroneous.

Reason: Outdated - iT2D 1.4.1 will have better tutorials

If you are able to revise this information, please do so and remove this 'update' flag when finished.

Contents

Xcode_iPhone

Now that we have a test game ready, we need to move into the compiler/source section of iTGB. Start by opening engine/compilers/Xcode_iPhone/Torque2D.xcodeproj. When the solution loads, scroll through the source folders until you find the Resources section. Expand this area (Shown in Figure 1).

Image:9_ExpandResources.jpg
Figure 1


Deleting Old References

If you are testing a new game, check to see if the Resources folder contains a common, game, and or main.cs If so, you'll need to select those items and delete them (Shown in Figure 2). You might be prompted by a Delete References dialog (Shown in Figure 3). If so, choose to delete the references, not the actual files.

Image:10_DeleteResources.jpg
Figure 2

Image:11_DeleteReferences.jpg
Figure 3

Adding Your Game References

Before you can compile, you'll need to add references to the key files required to run your game in the simulator. Open the menu to Add Existing Files (Shown in Figure 4). Image:12_AddExistingFiles.jpg
Figure 4

You should be presented with a file browser dialog. Navigate to your TouchGame directory. Select your common, game, and main.cs files (Shown in Figure 5). After you click Add, you will be presented with a new dialog presenting you with options for adding the files. Make sure your dialog matches the one Shown in Figure 6.

Image:13_SelectFiles.jpg
Figure 5

Image:14_CreateFolderReferences.jpg
Figure 6

Compiling and Running

You are down to the final steps (hold tight). With your game project created, DSO files compiled, references added to your solution, it's time to compile. You made need to modify your compile options. If you look to the top of your compiler bar, you might see drop-down menus that control Active SDK, Target, etc. If you click on one of those, such as the Active SDK (Shown in Figure 7), you can modify certain settings (Shown in Figure 8).

Image:15_ActiveSDK.jpg
Figure 7

Image:16_ChangeActiveSDK.jpg
Figure 8

Make sure your Compiler Options match the ones Shown in Figure 9. Once you are all set, click on the Build and Go command (Shown in Figure 10). If you have followed all the steps carefully, and there are no errors, your iPhone simulator should run displaying your first game project (huzzah!).

Image:17_CompilerOptions.jpg
Figure 9

Image:18_BuildAndGo.jpg
Figure 10

Image:19_SimulatorTest.jpg
Figure 11

If you click the Home Button (button with a square to the right), you will be taken to the iPhone home screen. You should see a TGB icon (Shown in Figure 12).

Image:20_HomeScreen.jpg
Figure 12


Conclusion

This was a very basic tutorial meant to show you how to create a TGB project and run it on the iPhone simulator. Later tutorials are going to show you how to add iPhone specific functionality (such as touching) to your game.