Misc
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,3 +20,4 @@ backup*
|
||||
start.bat
|
||||
__pycache__
|
||||
build/examples/arms_race
|
||||
raylib.py
|
||||
@@ -5,5 +5,5 @@ bld --dont_compile_core
|
||||
cd build
|
||||
core_main.exe examples/game2d.core
|
||||
bld --dont_compile_core --link=vendor/raylib/windows/raylibdll.lib
|
||||
rem a.exe
|
||||
rem build\generated_main.exe
|
||||
cd ..
|
||||
|
||||
@@ -61,6 +61,9 @@ Add :: (a: *Array($T), item: T)
|
||||
a.data = realloc(a.data, SizeOf(T) * a.cap->U64)
|
||||
a.data[a.len++] = item
|
||||
|
||||
Memes :: (a: S32, ...)
|
||||
pass
|
||||
|
||||
main :: (): int
|
||||
guys: Array(Guy)
|
||||
Add(&guys, {pos = {100, 100}})
|
||||
@@ -69,6 +72,7 @@ main :: (): int
|
||||
SetTargetFPS(60)
|
||||
for !WindowShouldClose()
|
||||
|
||||
Y := GetScreenHeight()
|
||||
g := guys.data
|
||||
if IsKeyDown(KEY_W);; g.pos.y -= 2
|
||||
if IsKeyDown(KEY_S);; g.pos.y += 2
|
||||
@@ -77,8 +81,10 @@ main :: (): int
|
||||
|
||||
|
||||
BeginDrawing()
|
||||
ClearBackground({100})
|
||||
ClearBackground(RAYWHITE)
|
||||
DrawFPS(0, 0)
|
||||
DrawText("Testing and stuff", 100, 100, 20, RAYWHITE)
|
||||
DrawCube({0,0,0}, 10, 10, 10, BLACK)
|
||||
for i := 0, i < guys.len, i += 1
|
||||
it := guys.data + i
|
||||
DrawCircleV(it.pos, 16, MAROON)
|
||||
|
||||
@@ -14,10 +14,13 @@ ClearBackground :: #foreign (color: Color)
|
||||
DrawCircle :: #foreign (centerX: int, centerY: int, radius: F32, color: Color)
|
||||
DrawCircleV :: #foreign (center: Vector2, radius: F32, color: Color)
|
||||
|
||||
DrawCube :: #foreign (position: Vector3, width: F32, height: F32, length: F32, color: Color)
|
||||
|
||||
DrawFPS :: #foreign (posX: int, posY: int)
|
||||
DrawText :: #foreign (text: *char, posX: int, posY: int, fontSize: int, color: Color)
|
||||
|
||||
|
||||
GetScreenWidth :: #foreign (): int
|
||||
GetScreenHeight :: #foreign (): int
|
||||
|
||||
IsKeyDown :: #foreign (key: int): Bool
|
||||
IsKeyPressed :: #foreign (key: int): Bool
|
||||
|
||||
Reference in New Issue
Block a user