Physics error?

Hi,

I’m currently working on my first project and when I try to load the physics engine everything stops working, why is that?

display.setStatusBar( display.HiddenStatusBar )

local physics = require “physics”
physics.start()
physics.setGravity( 0, 10 )

local background = display.newImage(“city-bg.png”)

local car = display.newImage(“car.png”)
car.x = 60
car.y = 160

local ambulance = display.newImage(“ambulance.png”)
ambulance.y = display.contentHeight/2
ambulance.x = 240

Also, could you please tell me how can I start the terminal to see the errors?

Thank you [import]uid: 8241 topic_id: 2836 reply_id: 302836[/import]

In your Corona folder, there is an entry called terminal. Start that, it will start the simulator on its own. [import]uid: 5712 topic_id: 2836 reply_id: 8420[/import]

Btw. that code you posted looks fine. [import]uid: 5712 topic_id: 2836 reply_id: 8421[/import]

Are you using the Game Edition or the regular SDK? [import]uid: 5712 topic_id: 2836 reply_id: 8422[/import]

Ahh, I have the free trial… which one is which? :slight_smile: [import]uid: 8241 topic_id: 2836 reply_id: 8425[/import]

The Game edition has the pool ball No.11 on the icon. [import]uid: 5712 topic_id: 2836 reply_id: 8426[/import]

being new here what are the differences other than trial and paid [import]uid: 10258 topic_id: 2836 reply_id: 8428[/import]

The game edition has the features of the Corona SDK, plus support for physics (Box2D), Spritesheets and OpenFeint. [import]uid: 5712 topic_id: 2836 reply_id: 8429[/import]

I have an Orange on the icon and blue background… [import]uid: 8241 topic_id: 2836 reply_id: 8430[/import]

Get it here:

https://developer.anscamobile.com/downloads/game-edition [import]uid: 5712 topic_id: 2836 reply_id: 8431[/import]

Thank you very much! :slight_smile: [import]uid: 8241 topic_id: 2836 reply_id: 8433[/import]

andreib21 said:
:: I have an Orange on the icon and blue background… ::

LOL. Good one! I’m gonna go pour myself a glass of Corona juice now… [import]uid: 10248 topic_id: 2836 reply_id: 8776[/import]

You need to to add your objects (movable ones) to the a physics body … (i.e. physics.addBody(myObject, {bounce=0.3, friction=5.0, density=4.0})
in addition, for those you don’t want them to be moved, just use the above sentence with physics.addBody(myStaticObject, “static”)
[import]uid: 11038 topic_id: 2836 reply_id: 10927[/import]