This is the solution i've found :
// Test collisions between obj1 and obj2, two sprites (obj1 is moving with tween)
function collision()
// No tween ? Exit
if GetTweenSpriteExists(obj1.tween) = 0
exitfunction false
endif
// No tween ? Exit
if GetTweenSpritePlaying(obj1.tween, obj1.Sprite) = 0
exitfunction false
endif
// Set the size of the tweening sprite
sx = 40 // obj1 Sprite width
sy = pow((obj1.x - obj1.oldx), 2) + pow((obj1.y - obj1.oldy), 2) // Get the collision length to test
if sy <> 0 then sy = sqrt(sy) // Pythagore...
inc sy, 40 // obj1 Sprite Height + Length to test
SetSpriteSize(colSpr, sx, sy + 40) // Resize the collision sprite, colSpr must be created before
SetSpriteOffset(colSpr, sx / 2, sy + 20) // Set the offset where it must be ( the 20 added is obj1 Sprite height / 2)
// Position the sprite by offset
SetSpritePositionByOffset(colSpr, obj1.oldx, obj1.oldy)
SetSpriteAngle(colSpr, spr1.angle + 90) // Angle must be updated if needed.
Update2D(0) // Update the sprites datas needed here ???
// Update the datas
obj1.oldx = obj1.x
obj1.oldy = obj1.y
// Collide with an other object ? (obj2)
if GetSpriteCollision(obj2, colSpr) = 1
exitfunction true // collided
endif
endfunction false
Don't let the world decrease your conatus