Game Development Community

TGB Camera Boundaries and another thing

by rennie moffat · in iTorque 2D · 04/11/2010 (10:03 am) · 11 replies

Hi, I am about ready to load my first app for the iPhone but I have a 2 questions.

1. how, can I load my game onto my iPhone ahead of submitting it to Apple and...
2. tho if I get 1. answered first this will negate my need to ask, but in TGB within the editor, there are 3 boxes which center the camera, or at least show the camera's position. My question is, I have made a few 480x320 px images and they are too small to cover all the way to the outside line. So my question is is the middle line the one which represents the 480x320 boundaries?




About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
04/11/2010 (11:51 am)
Hi Rennie,

In answer to your questions ...

1. You need to have the Apple developer subscription - this will allow you with Torque to compile and deploy your game to an iPhone or iPod Touch for testing.

2. Generally on the iPhone/iPod Touch the camera size is set to the same size as the device native resolution; 480x320 or 320x480. If you do this then I think you will find that your 480x320 image will fit to the edge of the larger box.

HTH
#2
04/11/2010 (2:32 pm)
thanks.
I do have the apple developer program. How would I get it onto there test program? XCode, just put in my files as a project? I guess.



Thanks in advance and testing on my own,
Cheers.


Ren
#3
04/11/2010 (3:01 pm)
The document "User Guide - Working with Torque2D for iPhone" which ships with 1.3.1 has full instructions for getting your game up and running in xCode and then onto the iPhone/iPod Touch.

#4
04/11/2010 (3:28 pm)
Sweet will do. Thanks. Quick qestion though, I have built 90% of a game in straight TGB thinking when the time comes I will be able to simply "switch over". Is this the case? And no worries, I will read up on the docs.
#5
04/11/2010 (3:46 pm)
Mostly okay - there are some gotchas - make sure physics is set to true for any object that needs to move - it is off by default on the iPhone. You will need to hook in the iPhone touch events/accelerometer if you plan to use those.
#6
04/11/2010 (3:52 pm)
my game uses no physics so that should be ok, and no accelerometer. Other than that I should be plug and play?



PS. its Sunday so excuse my laziness of not checking.
#7
04/12/2010 (4:42 am)
Okay, if you are not having anything moving then no physics is fine. If you are not using accelerometer then you will be using mouse or touch events. If mouse, then no change, otherwise you will need to plumb in the touch events.
#8
04/12/2010 (7:08 am)
ok just going over the docs. thanks!
#9
04/12/2010 (8:32 am)
Hi Scott,
I am slightly confused. after going over the docs. I am thinking essentially what I must do is.

create a new project in XCode,
then import my files, images and everything. However I am thinking some conversions my go on. I could be wrong, as I am just starting but I think a game.cs must be made into a game.h and my behavors.cs must be behaviors.cpp. If that is it, it does not seem like too much however, what about all the other files, the for audio, data blocks. Am I putting too much thought into this? Or is that what must be done, just the docs seemed unclear to me.


#10
04/12/2010 (9:15 am)
Hi Rennie,

This is what I basically did when I started ...

1. Open the example iphone project in xCode, setup your targets with your developer cert etc

MyProjects/iPhoneExample/buildFiles/XCode_iPhone/iTorque2D.xcodeproj

2. Clean and build/deploy to your iPhone. Confirm this is working.

3. You can the use this as a basis for your project.

4. You create the .cs files that are store in projectFiles/game/scripts etc. You don't need to convert these to c/c++

5. Your images and audio files are copied from datablocks.cs into the equivalent projectFiles/game/data/level/datablocks/<yourlevel>_datablocks,cs file.

6. You then repeat step 2 until you are satisfied with your game/app.
#11
04/12/2010 (9:27 am)
ok cool.

I tried to run the iTorque2D.xcodeproj i XCode last night but it wasn't working. In fact I was looking for "Clean and Build" but I could not find it. only Build, Build and Run. No clean though, I did see that in the tut.

Now worries though I will be looking into it more. I have some other things to polish up first tho.


Thanks
Ren