Currently in multiple projects my main character can only ever shoot (bullet, arrow, spell, etc) in one direction. I am not rotating the actor, just changing the image;
currently my code for attacking is,
I'm also using the GifImage class to have animated images.
So how would I have the projectile move in the direction the actor is facing?
//move right
if (Greenfoot.isKeyDown("right"))
{
setImage(runR.getCurrentImage);
move(10);
}
// move left
if (Greenfoot.isKeyDown("left"))
{
setImage(runL.getCurrentImage);
move(-10);
}if (Greenfoot.isKeyDown("d") && illusionBooks >= 1 && shotTimer <= 0)
{
setImage("Casting.png");
getWorld().addObject(new FearSpell(), getX()+50, getY()-50);
shotTimer = 25; // delay next shot
}
