Firing a bullet from my turret, and how to make the bullet ricochet

You can setup filters, so that only certain object will colide with other objects.

http://developer.coronalabs.com/forum/2010/10/25/collision-filters-helper-chart

Dave

[import]uid: 117617 topic_id: 32510 reply_id: 131100[/import]

I fixed the turret issue. : D

In reference to Q1 - I’m trying to use my own image for my bullet [lua] display.newImageRect(“bullet.png”) [/lua]

Problem - My bullet image has the ‘bullet’ facing North, and no matter what direction my turret may be pointing, North, East, West, South etc… whenever I fire, the bullet does travel in the direction my turret is pointing but the bullet image is still pointing North and upon impact with a wall the image starts spinning out of control…?

-Saer
[import]uid: 148623 topic_id: 32510 reply_id: 131422[/import]

http://docs.coronalabs.com/api/type/Body/isFixedRotation.html

Should help with the spinning.

The problem with your bullet facing north, can’t you change the rotation to the same as the turret ?

Dave [import]uid: 117617 topic_id: 32510 reply_id: 131465[/import]

I fixed the turret issue. : D

In reference to Q1 - I’m trying to use my own image for my bullet [lua] display.newImageRect(“bullet.png”) [/lua]

Problem - My bullet image has the ‘bullet’ facing North, and no matter what direction my turret may be pointing, North, East, West, South etc… whenever I fire, the bullet does travel in the direction my turret is pointing but the bullet image is still pointing North and upon impact with a wall the image starts spinning out of control…?

-Saer
[import]uid: 148623 topic_id: 32510 reply_id: 131422[/import]

I tried to change the bullet’s angle to match whatever the current angle of the turret happened to be, but it didn’t work. [import]uid: 148623 topic_id: 32510 reply_id: 131503[/import]

http://docs.coronalabs.com/api/type/Body/isFixedRotation.html

Should help with the spinning.

The problem with your bullet facing north, can’t you change the rotation to the same as the turret ?

Dave [import]uid: 117617 topic_id: 32510 reply_id: 131465[/import]

I tried to change the bullet’s angle to match whatever the current angle of the turret happened to be, but it didn’t work. [import]uid: 148623 topic_id: 32510 reply_id: 131503[/import]