I have a truck that will pick up and place crates, but when placing them I want it to always place it behind the truck, how would I do this?
This is my current code for placing the crates:
The "-50" is so it does not pick it back up after placing it, I would need this to be some how implemented into the rotation placement as well.
Thanks ahead of time!
if (crateGrab>0)
{
if (Greenfoot.isKeyDown("space")==true)
{
Crate newCrate = new Crate();
getWorld().addObject(newCrate, getX()-50, getY());
setImage("truck.png");
crateGrab=crateGrab-1;
}
}

