how to check for collisions between objects?
- Code: Select all
if EntityCollided(Entity1, Entity2) then
--...
end
if EntityCollided(Entity1, Entity2) then
--...
end
function onUpdate( timeDelta )
x,y,z = entity.getPosition( obj );
entity.move(obj,0,moveSpeed*timeDelta,0);
particle.setParticlePosition( fxid,x, y, z );
if(y > height) then
delete();
else
if(entity.isColliding(obj,0,1,0,2)>0) then
entity.delete(entity.getLastHitEntityID());
delete();
end
end
end
if(entity.isColliding(obj,0,1,0,2)>0) then...
entity.delete(entity.getLastHitEntityID());
Users browsing this forum: No registered users and 39 guests