-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.fs
36 lines (30 loc) · 866 Bytes
/
Program.fs
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
open Substrate
open GameCore.GameModel
open GameCore.GameRunner
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Input
let width, height = 900, 900
let backColour = Color.White
let foreColour = Color.Black
[<EntryPoint>]
let main _ =
let config = {
clearColour = Some backColour
resolution = Windowed (width, height)
assetsToLoad = []
fpsFont = None
}
let updateModel runState world =
match world with
| None -> Some <| initWorld width height
| _ when wasJustPressed Keys.Escape runState -> None
| Some world ->
Some <| advanceWorld world
let getView _ world =
[
yield! world.grid |> Map.toList |> List.map (fun ((x, y), _) ->
Colour ((x, y, 1, 1), foreColour))
]
runGame config updateModel getView
0