...
This commit is contained in:
@@ -22,13 +22,6 @@ extern "main" func main(args: []cstring): i64
|
|||||||
|
|
||||||
while !raylib::WindowShouldClose()
|
while !raylib::WindowShouldClose()
|
||||||
{
|
{
|
||||||
raylib::BeginDrawing()
|
|
||||||
{
|
|
||||||
raylib::ClearBackground(bgColor);
|
|
||||||
raylib::DrawRectangle(x, y, width, height, color)
|
|
||||||
}
|
|
||||||
raylib::EndDrawing()
|
|
||||||
|
|
||||||
if x <= 0
|
if x <= 0
|
||||||
{
|
{
|
||||||
direction.x = 1
|
direction.x = 1
|
||||||
@@ -48,6 +41,13 @@ extern "main" func main(args: []cstring): i64
|
|||||||
|
|
||||||
x = x + @floatToInt(i32, direction.x * speed * raylib::GetFrameTime())
|
x = x + @floatToInt(i32, direction.x * speed * raylib::GetFrameTime())
|
||||||
y = y + @floatToInt(i32, direction.y * speed * raylib::GetFrameTime())
|
y = y + @floatToInt(i32, direction.y * speed * raylib::GetFrameTime())
|
||||||
|
|
||||||
|
raylib::BeginDrawing()
|
||||||
|
{
|
||||||
|
raylib::ClearBackground(bgColor);
|
||||||
|
raylib::DrawRectangle(x, y, width, height, color)
|
||||||
|
}
|
||||||
|
raylib::EndDrawing()
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user