Hi.
I am currently using a very primitive way of holding weapons in the game, I will change it later.
Atm, it’s like this:
override public function update():void
{
var e:Hero = collide("hero", x, y) as Hero;
if (Hero.isFacingLeft)
{
sprSword.flipped = true;
}else
{
sprSword.flipped = false;
}
//Make hero pick it up
if (!pickedUp)
{
if (e)
{
pickedUp = true;
}
}
if (pickedUp)
{
if (Hero.isFacingLeft)
{
x = e.x - 99;
}else {
x = e.x +99;
}
y = e.y + 10;
}
blablabal
}
if x = e.x - 99;, then the game crashes! and if I change
if (Hero.isFacingLeft)
{
x = e.x - 99;
}else {
x = e.x +99;
}
to
if (Hero.isFacingLeft)
{
x = e.x - 99;
}else {
x = e.x +100; //look here
}
then it also crashes. It’s so weird!