Game Development Community

TGB 1.7.4 to iTGB 1.0.1 physics

by Bryan Duke · in iTorque 2D · 10/13/2008 (7:07 pm) · 29 replies

I have a simple game I created in TGB 1.7.4 that, among other things, has some balls that bounce around the screen. When I created the game in TGB, I set each of the balls with an initial X & Y velocity under the Physics dropdown. When I run the game under TGB, everything moves around the screen as expected.

When I load the project/level in iTGB 1.0.1 and hit the "Play Scene" button, the balls do not move. I cross checked the initial velocities in the Physics dropdown & there wasn't any change from what I set them in TGB. I tried adjusting the initial velocities in iTGB, but still no luck.

Any thoughts? Thanks!
Page«First 1 2 Next»
#21
10/15/2008 (4:32 pm)
If PUAP_OPTIMIZE is not defined, the physics ConsoleMethod and member variable that enable or disable physics do not work (not defined).

The binary and TGB editor that ship were built from the xCode project, which has the preproc defined.

Remember, the SDK ships with 3 xCode projects. You have to separate there purpose and functionality.
#22
10/15/2008 (4:37 pm)
I understand this, all I'm saying is this:

1) default Xcode project (e.g. binary & TGB editor) have PUAP_OPTIMIZE defined and hence by default, physics are disabled.
2) the Xcode-Iphone project does not have PUAP_OPTIMIZE defined and hence isn't using any of the optimizations that you proposed (even if the user wanted to)...

So 1) is basically useless since why would we care too much whether or not physics slows things down in the binary or TGB editor.

We care more in 2)...

I think there is simply a configuration bug here...
#23
10/15/2008 (4:41 pm)
That's just how the projects shipped out. For the next version, we'll ship xCode and xCode_iPhone with the same configuration.

For now, at least you know what you can turn on and off during development =)
#24
10/15/2008 (4:44 pm)
Thanks Michael! I was only confirming that this was just a configuration issue.

for now, I simply removed the preproc from the binary & builder...
#25
11/06/2008 (8:39 am)
Just as a heads up to someone who may be having the same issue, without setting the %object.setUsesPhysics( true );, I couldn't make my t2dStaticSprite move using the 'moveTo' function.
#26
11/09/2008 (9:27 am)
Not sure if that's related at all. but for some reason I have collisions that consistantly working on the iPhone and not on the mac. it's really annoying since I have to upload to the device for every little change. Is there any optimization flag that we need to set for collisions too? like object.setUsesCollisions(true)?
#27
11/11/2008 (12:15 pm)
Sorry for the confusion here,
There is a single PUAP_OPTIMIZE compile flag that you set in your project to turn this on, you shouldn't have to do anything else. If you want everything to run in default mode, you don't have to set that compile flag and subsequently don't have to add setUsesPhysics to your game objects.

We added the setUsesPhysics option for the optimized version because physics calls go into script every frame for every object even if they aren't moving or collidable. That is the only script variable you need to enable int the optimized version and then everything should work as designed.

Sound is not supported on the simulator, that is an Apple simulator thing, and has nothing to do with iTGB, can't do anything about that at the moment
#28
11/11/2008 (12:55 pm)
Then It sounds like a good idea to set the PUAP_OPTIMIZE and enable/disable objects physics based on your specific needs. How do you set it ?
I tried creating a user-defined PUAP_OPTIMIZE in the xcode target and it doesn't seem to do anything.
#29
11/11/2008 (1:41 pm)
Ok found it. it's in the Preprocessor Macros of the target.
Page«First 1 2 Next»