Hey again, I’m trying to make my player shoot. Here’s what I’ve done: Bullet:
public function Bullet(posx:int, posy:int)
{
graphic = new Image(BULLET_ART);
graphic.scrollY = 2;
x = posx;
y = posy;
setHitbox(10, 10);
type = "bullet";
}
override public function update():void
{
y += 300 * FP.elapsed;
}
Player Update:
if (Input.check(Key.SPACE))
{
var bullet:Bullet = new Bullet(x, y + 5);
FP.world.add(Bullet());
}
Not even showing errors, just throwing me a good ol’ white screen, as it usually does when something is wrong. Any help?