Add float to int builtin
This commit is contained in:
@@ -6,11 +6,30 @@ module "main"
|
||||
extern "main" func main(args: []cstring): i64
|
||||
{
|
||||
raylib::InitWindow(1600, 900, "Hi from nub-lang")
|
||||
raylib::SetTargetFPS(240)
|
||||
|
||||
let x: i32 = 0
|
||||
let y: i32 = 0
|
||||
|
||||
let width: i32 = 100
|
||||
let height: i32 = 100
|
||||
|
||||
let direction: raylib::Vector2 = { x = 1 y = 1 }
|
||||
|
||||
let bgColor: raylib::Color = { r = 0 g = 0 b = 0 a = 255 }
|
||||
let color: raylib::Color = { r = 255 g = 255 b = 255 a = 255 }
|
||||
|
||||
while !raylib::WindowShouldClose()
|
||||
{
|
||||
raylib::BeginDrawing()
|
||||
{
|
||||
raylib::ClearBackground(bgColor);
|
||||
raylib::DrawRectangle(x, y, width, height, color)
|
||||
}
|
||||
raylib::EndDrawing()
|
||||
|
||||
x = x + @floatToInt(i32, direction.x)
|
||||
y = y + @floatToInt(i32, direction.y)
|
||||
}
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user