Enemy collision configuration
What happens when the enemy character collides with something (a player or world). Here, we'll configure the enemy state (dead or alive) based on what it collides with.
function collideEnemyWithPlatform(dx,dy,v,obj) if obj == player then --if the player lands on the top of the enemy character, kill enemy if (player.t + player.h < v.t + 8) then EnemyDie(v) else --else if the above condition is not met, kill player Die() end end end