Inital boiler plate commit.
Initial setup done, debug mode, build script, simple entry point, simple game manager setup. Ideal starting point for my games.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package game
|
||||
|
||||
import rl "vendor:raylib"
|
||||
|
||||
WINDOW_TITLE :: "Pong"
|
||||
WINDOW_WIDTH :: 2560
|
||||
WINDOW_HEIGHT :: 1440
|
||||
|
||||
State :: enum {
|
||||
IN_GAME,
|
||||
MENU,
|
||||
LOADING,
|
||||
PAUSED,
|
||||
FINISHED
|
||||
}
|
||||
|
||||
Game :: struct {
|
||||
state: State
|
||||
}
|
||||
|
||||
// @NOTE: procs ie: game_init, game should run etc is a convention to work with wasm
|
||||
game_should_run :: proc() -> bool { return !rl.WindowShouldClose( )}
|
||||
|
||||
game_init :: proc(game: ^Game) {
|
||||
rl.InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE)
|
||||
rl.SetTargetFPS(60)
|
||||
|
||||
game.state = .IN_GAME
|
||||
}
|
||||
|
||||
game_update :: proc(game: ^Game) {
|
||||
// get delta time for frame
|
||||
dt := rl.GetFrameTime()
|
||||
}
|
||||
|
||||
game_render :: proc(game: ^Game) {
|
||||
rl.BeginDrawing()
|
||||
rl.ClearBackground(rl.DARKGRAY)
|
||||
rl.EndDrawing()
|
||||
}
|
||||
|
||||
game_quit :: proc(game: ^Game) {
|
||||
rl.CloseWindow()
|
||||
}
|
||||
Reference in New Issue
Block a user