So i was trying to follow this tutorial https://www.youtube.com/watch?v=BVC8_7pORJ0
and i'm trying to imply hitByProjectile method but suddenly the game crashes, here's the code on my
Enemy1 Class
public class Enemy1 extends Enemy
{
public Enemy1()
{
setRotation(90);
}
public void act()
{
// Add your action code here.
moveEnemy();
removeEnemy();
hitByProjectile();
}
public void hitByProjectile()
{
Actor projectile = getOneIntersectingObject(Projectile.class);
if(projectile != null)
{
getWorld().removeObject(projectile);
getWorld().removeObject(this);
}
}
}