mirror of https://github.com/mode777/rayjs.git
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import * as rlc from "raylib.core"
|
|
import { loadImage } from "raylib.texture"
|
|
import { gc } from "std"
|
|
|
|
// Initialization
|
|
//--------------------------------------------------------------------------------------
|
|
const screenWidth = 800;
|
|
const screenHeight = 450;
|
|
|
|
rlc.initWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
|
|
|
|
rlc.setTargetFPS(60); // Set our game to run at 60 frames-per-second
|
|
//--------------------------------------------------------------------------------------
|
|
|
|
|
|
// Main game loop
|
|
while (!rlc.windowShouldClose()) // Detect window close button or ESC key
|
|
{
|
|
// Update
|
|
//----------------------------------------------------------------------------------
|
|
// TODO: Update your variables here
|
|
//----------------------------------------------------------------------------------
|
|
|
|
// Draw
|
|
//----------------------------------------------------------------------------------
|
|
rlc.beginDrawing();
|
|
|
|
rlc.clearBackground(rlc.RAYWHITE);
|
|
|
|
rlc.drawText("Congrats! You created your first window!", 190, 200, 20, rlc.LIGHTGRAY);
|
|
|
|
rlc.endDrawing();
|
|
//----------------------------------------------------------------------------------
|
|
}
|
|
|