-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
56 lines (40 loc) · 1.05 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SPDX-FileCopyrightText: 2023 Andrew Engelbrecht <[email protected]>
//
// SPDX-License-Identifier: MIT
//
// starting point - this is a part of lets-make-salad
package main
import (
"os"
"log"
"github.com/gen2brain/raylib-go/raylib"
"github.com/leaf-node/lets-make-salad/src/game"
"github.com/leaf-node/lets-make-salad/src/draw"
"github.com/leaf-node/lets-make-salad/src/input"
)
var gridSize = int32(250)
var noiseScale = 0.1
var height = int32(704)
var width = int32(1280)
func main() {
if len(os.Args) > 2 {
log.Fatal("lets-make-salad takes one optional, arbitrary seed argument.\n")
}
var seed string
if len(os.Args) == 2 {
seed = os.Args[1]
} else {
seed = "letsmakesalad"
}
world := game.Init(seed, gridSize, noiseScale)
startLoop(world)
}
func startLoop (world *game.World) {
draw.Init(width, height, gridSize, gridSize)
for !rl.WindowShouldClose() {
input.HandleInput()
world.Update()
draw.Draw(world)
}
rl.CloseWindow()
}