shooting help

hello friends,

I am developing a game in which i wanted to have a shooting of the object in different direction. detail:

I wanted to shoot an object in the specific direction. as once i touch the object and move it should rotate in direction of movement and when i release the touch the object should move in the direction which is the final angle of rotation.

The ref is Bubble blaster game. in similar manner i wanted to release the object.here is the game ref game link: http://www.bubbleblaster.org/

hoping for your reply asap.

Regards
Varun [import]uid: 130269 topic_id: 24415 reply_id: 324415[/import]

Try something like this

[code]
local vel = 100
local sin = math.sin
local cos = math.cos
local rad = math.rad

myObject:setLinearVelocity(sin(rad(event.x)) * vel, cos(rad(event.y)) * -vel)
[/code] [import]uid: 84637 topic_id: 24415 reply_id: 99195[/import]

Hi Danny,

Thanks for your help but i wanted to know how shall i move the aiming image as the touch moves. as i given in ref. Please reply me soon as my game is completed only this feature is left.

Hoping for your reply soon.

Regards
Varun [import]uid: 130269 topic_id: 24415 reply_id: 99427[/import]

I’m still not entirely clear as to what you are looking to achieve here… However.

Try this

--In your touch handler if event.phase == "ended" then transition.to(objectToTransition, {x = event.x, y = event.y}) end [import]uid: 84637 topic_id: 24415 reply_id: 99536[/import]

Hi

See please check the link I provided in my first message I want similarly release object as ball gets release in the link. [import]uid: 130269 topic_id: 24415 reply_id: 99576[/import]