Hello, I have run into a bug in my flashpunk code that i also noticed in the breakout game demo for haxepunk. I am unaware of the cause, and therefore don’t know how to fix it, but if I make an entities velocity to fast, it ignores simple bounds checking and goes out of bounds, never to be seen again.`
public function MyEntity()
{
graphic = new Image(PLAYER);
graphic.x = 320;
graphic.y = 240;
xa = 20;
ya = 20;
}
override public function update():void
{
var x:int = Input.mouseX;
var y:int = Input.mouseY;
if (graphic.y == 520)
{
ya = -ya;
}
if (graphic.x == 700)
{
xa = -xa;
}
if (graphic.y == -40)
{
ya = -ya;
}
if (graphic.x == -50)
{
xa = -xa;
}
graphic.x += xa;
graphic.y += ya;
}`
Any Help, on how to fix the bounds checking would be much appreciated.