Top view race game

Hi everybody. First of all im very very newbie in corona and lua and my english are terrible
i would like to make topview race game but i dont know what to do to start a car and make a lap in a single track. I use transition and linearVelocity. i use this code for a sample and make some changes but the car go to a straight line and not turn.

[lua]W = display.contentWidth
H = display.contentHeight

print(W)
print(H)

physics = require (“physics”)
physics.start()

system.activate(“multitouch”);
local track = display.newImageRect(“track.png”,2048,2048)
track:setReferencePoint(display.CenterReferencePoint)
track.x = W/2*4.2
track.y = H/2
physics.addBody(track,“dynamic”,{density=.5, friction = 1})

local car = display.newImageRect(“yellowcar.png”,90,140)
car:setReferencePoint(display.CenterReferencePoint)
car.x = W/2
car.y = H/2
local up = display.newImage(“upx.png”);
up.x = 440; up.y = 750;

local left = display.newImage(“leftx.png”);
left.x = 40 ; left.y = 750;

local right = display.newImage(“rightx.png”);
right.x = 95; right.y = 750;

local motionx = 0;

local function stop (event)
if(event.phase == “ended”) then
motionx = 0;
end
end
Runtime:addEventListener(“touch”, stop );
function left:touch()
motionx = 5;
end
left:addEventListener(“touch”, left);

function right:touch()
motionx = -5;

end
right:addEventListener(“touch”, right);

function moveTrack(event)
track.x = track.x + motionx
track.y = track.y + motionx
end
Runtime:addEventListener(“enterFrame”, moveTrack);

function moveCar(event)
track:setLinearVelocity(0,0)
–transition.to( track, { time=1500, alpha=1, x=(W/2*4.2), y=(1000) } )
end
up:addEventListener(“tap”, moveCar);[/lua] [import]uid: 209841 topic_id: 34495 reply_id: 334495[/import]

here is the track and the car

http://dl.dropbox.com/u/11765686/track.png

http://dl.dropbox.com/u/11765686/yellowcar.png [import]uid: 209841 topic_id: 34495 reply_id: 137129[/import]

I would think that you need to either keep track of where the car is and turn it yourself or if you use something like Physics Editor, you can setup a very complex physics shape for the track and let your car treat the sides as walls.

A lot will need to be decided by what you want to do if the car runs off the track and if the player is turning the car or if you want it to turn automatically. [import]uid: 199310 topic_id: 34495 reply_id: 137157[/import]

here is the track and the car

http://dl.dropbox.com/u/11765686/track.png

http://dl.dropbox.com/u/11765686/yellowcar.png [import]uid: 209841 topic_id: 34495 reply_id: 137129[/import]

I would think that you need to either keep track of where the car is and turn it yourself or if you use something like Physics Editor, you can setup a very complex physics shape for the track and let your car treat the sides as walls.

A lot will need to be decided by what you want to do if the car runs off the track and if the player is turning the car or if you want it to turn automatically. [import]uid: 199310 topic_id: 34495 reply_id: 137157[/import]