Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created October 6, 2019 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/0254e172fb20d003213660860a42d6c0 to your computer and use it in GitHub Desktop.
Save IntegerMan/0254e172fb20d003213660860a42d6c0 to your computer and use it in GitHub Desktop.
let getRandomPos(maxX:int32, maxY:int32, getRandom): WorldPos =
let x = getRandom maxX
let y = getRandom maxY
newPos x y
let buildItemsArray (maxX:int32, maxY:int32, getRandom): Actor array =
[| { Pos = getRandomPos(maxX, maxY, getRandom); ActorKind = Squirrel false }
{ Pos = getRandomPos(maxX, maxY, getRandom); ActorKind = Tree }
{ Pos = getRandomPos(maxX, maxY, getRandom); ActorKind = Doggo }
{ Pos = getRandomPos(maxX, maxY, getRandom); ActorKind = Acorn }
{ Pos = getRandomPos(maxX, maxY, getRandom); ActorKind = Rabbit }
|]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment