I'm working on an assignment for school in which we make a small game using monogame, with the added challenge of working in F#. The game logic is fully immutable F#, and the entrypoint is in C# by use of the Game class in monogame. I have however come across a weird problem concerning Record types in F#. In the logic (F#) I have something along the lines of:
...
module Vectors =
type Vector = {
x : double
y : double
}
let Zero : Vector = {x=0.0; y=0.0}
...
And in C# I have some code accessing Zero:
...
player.vector = Vectors.Zero;
...
Weirdly enough, when I try to now use player.vector, it comes up as null. When debugging Vector.Zero is also null. I've looked around for a few solutions, and it may be some trivial mistake, but I can't seem to find it.
Positions
? In your code the module has nameVectors
– Maraca