Hi. I have a sword with this code in the update function:
if (collide("hero", x, y))
{
if (!pickedUp)
{
pickedUp = true;
}
}
if (pickedUp)
{
x = "hero".x
y = "hero".y //fixed typo :p
}
It doesn’t work!
Here is the hero class:
public function Hero(p:Point)
{
blabalbal
type = "hero";
}
Essentially, what I want to do is to make the sword follow the ENTITY that touches it. So if an enemy touches it, it follows that enemy, a.k.a the enemy PICKS IT UP.
Thank you in advance