How to get started on an iphone game with the new Torque 2d
by Kirsten Kane · in Torque 2D Beginner · 06/17/2013 (12:42 pm) · 7 replies
With the recent switch to open source over at github, the process became very unfamiliar with how I learned how to use t2d a few months ago. I followed the first few 'how to' videos on youtube, but I still haven't seem to gotten anywhere. My question is, what's the basic setup for starting an iphone game with the engine as it is? I built the ios version using xcode but I can't find the executable anywhere, and I haven't a clue how to test my scripts or using different touch inputs.
I only just recently switched to ios development so I'm still pretty new, any advice would be much appreciated
About the author
Fourth year computer science student at University of California Irvine, working as an intern in web development. I've always had a passion for games and have just begun the jump into game development
#2
So is there no way for me to test my game using xcode on my computer? I'm just having a hard time figuring out what I need to do to customize the file to be my game. Do I need to compile the engine separately and then begin working with it on my computer? Or do I modify the games files like the module folder and just continue to add my own scripts. I tried the latter, even deleting everything in the modules folder and it continues to run the demo project.
06/18/2013 (9:55 am)
Hey Michael, thanks for respondingSo is there no way for me to test my game using xcode on my computer? I'm just having a hard time figuring out what I need to do to customize the file to be my game. Do I need to compile the engine separately and then begin working with it on my computer? Or do I modify the games files like the module folder and just continue to add my own scripts. I tried the latter, even deleting everything in the modules folder and it continues to run the demo project.
#3
If you are using another folder that is not named "modules", you need to update the Xcode project itself.
If you are able to, provide the following:
1. Describe your folder structure
2. Take a screenshot of the Xcode project with the resources folder expanded
When I start a fresh project, here is what I do.
1. Clone the repository
2. Delete all modules except the AppCore
3. Create a new module, named something like "MyGame"
4. Add a module definition to "MyGame"
5. Create, edit, and execute the scripts in "MyGame"
6. Open engine/compilers/Xcode_iOS/Torque2D.xcodeproj
7. Clean
8. Build
9. Run
That always works.
06/18/2013 (10:37 am)
Quote:So is there no way for me to test my game using xcode on my computer?You can only use Xcode, which means you must be on OS X.
Quote:Do I need to compile the engine separately and then begin working with it on my computer?No. The easiest thing to do is use the Xcode project we provide.
Quote: Or do I modify the games files like the module folder and just continue to add my own scripts.It really begins how your project is structured. I'm not sure how you started, what your folder structure is, or how your scripts are organized. The Xcode project we provide includes the main.cs in the root folder and all the contents in the modules folder, as its resources.
If you are using another folder that is not named "modules", you need to update the Xcode project itself.
If you are able to, provide the following:
1. Describe your folder structure
2. Take a screenshot of the Xcode project with the resources folder expanded
When I start a fresh project, here is what I do.
1. Clone the repository
2. Delete all modules except the AppCore
3. Create a new module, named something like "MyGame"
4. Add a module definition to "MyGame"
5. Create, edit, and execute the scripts in "MyGame"
6. Open engine/compilers/Xcode_iOS/Torque2D.xcodeproj
7. Clean
8. Build
9. Run
That always works.
#4
My file architecture is basically the same save for a few name changes to the xcodeproject name
http://i.imgur.com/sXx6dDE.png
Is it a name changing issue or that it's in a different directory? Eventually I want to change the git repo to something of my own, and have the app name be my own, as right now it's only Torque2d
06/18/2013 (2:11 pm)
Ah I see. I followed all of those steps modifying the repository and it definitely worked, but when I copied it to a different directory and changed the name of the project it ran completely differently, running the toy truck demo instead.My file architecture is basically the same save for a few name changes to the xcodeproject name
http://i.imgur.com/sXx6dDE.png
Is it a name changing issue or that it's in a different directory? Eventually I want to change the git repo to something of my own, and have the app name be my own, as right now it's only Torque2d
#5
06/21/2013 (5:50 am)
@Kirsten - Thanks for your patience explaining this problem. Could you please provide the step-by-step process of moving files and renaming elements of the project? It will also help to see your "Resources" folder in Xcode: my resources folder.
#6
1. Clone Repository
2. Moved everything under Torque2d folder, deleted the git resources
3. Deleted All modules except for AppCore in Resources/Modules folder
4. Opened the xcode project in engine/compilers/xcode_ios
5. Renamed project under Identity -> Project Name, which then asked me to change any project-related files
6. Build
7. Run
I wonder if it's because I didn't clean the project? beforehand? It actually seems to be working now for some reason, while a few days ago it wasn't O.o
Edit: Oh, and my resources folder: http://imgur.com/x5KuhNG
06/24/2013 (10:08 am)
Sure thing! I did this:1. Clone Repository
2. Moved everything under Torque2d folder, deleted the git resources
3. Deleted All modules except for AppCore in Resources/Modules folder
4. Opened the xcode project in engine/compilers/xcode_ios
5. Renamed project under Identity -> Project Name, which then asked me to change any project-related files
6. Build
7. Run
I wonder if it's because I didn't clean the project? beforehand? It actually seems to be working now for some reason, while a few days ago it wasn't O.o
Edit: Oh, and my resources folder: http://imgur.com/x5KuhNG
#7
One other tip, definitely include the preferences.cs file in your resources folder for Xcode. If you look at my image again, you will see main.cs, preferences.cs, and then several module folders. If you are explicitly loading your own module through script, it's not a problem. If you are using the Sandbox to load modules, you will need to have the preferences.cs pushed to the device as well.
06/26/2013 (7:32 am)
Cleaning the project greatly increases the changes of pushing the latest build to your device. I've encountered a persistent bug in Xcode that sometimes will push an older build from the temporary Xcode directory in the Library. More than once in the past, I've had to clean the project and delete the temp directory to get the correct build. This has to do with how Xcode will associate a project ID with a build directory, or something like that.One other tip, definitely include the preferences.cs file in your resources folder for Xcode. If you look at my image again, you will see main.cs, preferences.cs, and then several module folders. If you are explicitly loading your own module through script, it's not a problem. If you are using the Sandbox to load modules, you will need to have the preferences.cs pushed to the device as well.
Community Manager Michael Perry
ZombieShortbus