Update C sources, add new functions and rename package to
This commit is contained in:
parent
391c25482d
commit
08aa518a46
156 changed files with 34542 additions and 19573 deletions
|
@ -7,32 +7,32 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
raylib.InitWindow(800, 450, "raylib [core] example - generate random values")
|
||||
rl.InitWindow(800, 450, "raylib [core] example - generate random values")
|
||||
|
||||
framesCounter := 0 // Variable used to count frames
|
||||
randValue := raylib.GetRandomValue(-8, 5) // Get a random integer number between -8 and 5 (both included)
|
||||
randValue := rl.GetRandomValue(-8, 5) // Get a random integer number between -8 and 5 (both included)
|
||||
|
||||
raylib.SetTargetFPS(60)
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
for !raylib.WindowShouldClose() {
|
||||
for !rl.WindowShouldClose() {
|
||||
framesCounter++
|
||||
|
||||
// Every two seconds (120 frames) a new random value is generated
|
||||
if ((framesCounter / 120) % 2) == 1 {
|
||||
randValue = raylib.GetRandomValue(-8, 5)
|
||||
randValue = rl.GetRandomValue(-8, 5)
|
||||
framesCounter = 0
|
||||
}
|
||||
|
||||
raylib.BeginDrawing()
|
||||
rl.BeginDrawing()
|
||||
|
||||
raylib.ClearBackground(raylib.RayWhite)
|
||||
rl.ClearBackground(rl.RayWhite)
|
||||
|
||||
raylib.DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, raylib.Maroon)
|
||||
rl.DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, rl.Maroon)
|
||||
|
||||
raylib.DrawText(fmt.Sprintf("%d", randValue), 360, 180, 80, raylib.LightGray)
|
||||
rl.DrawText(fmt.Sprintf("%d", randValue), 360, 180, 80, rl.LightGray)
|
||||
|
||||
raylib.EndDrawing()
|
||||
rl.EndDrawing()
|
||||
}
|
||||
|
||||
raylib.CloseWindow()
|
||||
rl.CloseWindow()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue