var helmetCollideMedium:Helmets_medium = collide("helmet", x, y) as Helmets_medium;
var helmetCollideLarge:Helmets_large = collide("helmet", x, y) as Helmets_large;
if (helmetCollideMedium != null && equippedHelmet == null) equippedHelmet = helmetCollideMedium;
if (helmetCollideLarge != null && equippedHelmet == null) equippedHelmet = helmetCollideLarge;
I get an error @ this line:
if (helmetCollideLarge != null && equippedHelmet == null) equippedHelmet = helmetCollideLarge;
Helmets classes:
public class Helmets extends Entity
{
public var flipped:Boolean = false;
public function Helmets (x:Number=0, y:Number=0, graphic:Graphic=null, mask:Mask=null)
{
super(x, y, graphic, mask);
layer = -1;
type = "helmet"
}
public function updatePosition(xloc:Number, yloc:Number):void
{
}
public function equipped():void
{
}
}
Large:
public class Helmets_large extends Helmets
{
public function Helmets_large(x:Number=0, y:Number=0, graphic:Graphic=null, mask:Mask=null)
{
super(x, y, graphic, mask);
}
}
Medium:
public class Helmets_medium extends Helmets
{
public function Helmets_medium(x:Number=0, y:Number=0, graphic:Graphic=null, mask:Mask=null)
{
super(x, y, graphic, mask);
}
}
Iām very confusedā¦