unary op bugfix
This commit is contained in:
@@ -28,14 +28,21 @@ extern "main" func main(args: []cstring): i64
|
||||
}
|
||||
raylib::EndDrawing()
|
||||
|
||||
if x + width >= raylib::GetScreenWidth() || x <= 0
|
||||
if x <= 0
|
||||
{
|
||||
direction.x = -direction.x
|
||||
direction.x = 1
|
||||
}
|
||||
|
||||
if y + height >= raylib::GetScreenHeight() || y <= 0
|
||||
else if x + width >= raylib::GetScreenWidth()
|
||||
{
|
||||
direction.y = -direction.y
|
||||
direction.x = -1
|
||||
}
|
||||
else if y <= 0
|
||||
{
|
||||
direction.y = 1
|
||||
}
|
||||
else if y + height >= raylib::GetScreenHeight()
|
||||
{
|
||||
direction.y = -1
|
||||
}
|
||||
|
||||
x = x + @floatToInt(i32, direction.x)
|
||||
|
||||
Reference in New Issue
Block a user