Collision detection problem using TNT Collision engine - Gideros Forum

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Top Posters

• ar2rsawseen 6991
• SinisterSoft 3812
• hgy29 2462
• keszegh 2055
• antix 2033
• OZApps 1983
• totebo 1764
• oleg 1574
• hgvyas123 1412
• techdojo 1321
• phongtt 1029
• Mells 1024
• MikeHart 1020
• john26 995
• GregBUG 962
• pie 960
• talis 908
• Scouser 898
• Apollo14 868
• MoKaLux 841

# Collision detection problem using TNT Collision engine

edited June 2014
I have this piece of code to detect collision between an object 'sechand' which is rotating and a character which is translating along boundary of ellipse. Now, I am using TNT collision Engine to detect collsiions. It does detect collision but only if I never jump the character, Once I jump it, it never detects the collision happening any time in the game .I
have attached the snapshot in this post as well.

if playertouch then
speed = 10
angle2 = 30
speedx = math.cos(20)
speedy = math.sin(130)
velocityx = speed*speedx
velocityy = speed*speedy
point = tntCollision.pointToObox
x = x + velocityx
y = y + velocityy
self: setScaleY(1.8)
if point (x, y, sechand:getX(), sechand:getY(),206, 64, sechand:getRotation()) then
tntCollision.setCollisionAnchorPoint(0.2257, 0.5)
end

elseif playertouch == false then
x = x - velocityx
y = y - velocityy
x = 215 + math.cos(angle)*195
y = 130 + math.sin(angle)*115
self:setScaleY(1)
if point (x, y, sechand:getX(), sechand:getY(),206, 64, sechand:getRotation()) then
tntCollision.setCollisionAnchorPoint(0.2257, 0.5)
end
else
x = 215 + math.cos(angle)*195
y = 130 + math.sin(angle)*115
if point (x, y, sechand:getX(), sechand:getY(),206, 64, sechand:getRotation()) then
tntCollision.setCollisionAnchorPoint(0.2257, 0.5)
print('end of game')
end
end
self:setPosition(x,y)
cap.PNG 170.4K