I am working on a task for a school in which we make a small game using monogame, with the added task of working in F #. The logic of the game is completely unchanged F #, and the entry point is in C # using the Game class in a monogame. However, I had a strange problem with record types in F #. In the logic (F #), I have something like:
... module Vectors = type Vector = { x : double y : double } let Zero : Vector = {x=0.0; y=0.0} ...
And in C #, I have a Zero access code:
... player.vector = Vectors.Zero; ...
Oddly enough, when I try to use player.vector, it appears as null. When debugging, Vector.Zero is also null. I was looking for several solutions, and this might be some kind of trivial error, but I cannot find it.
c # visual-studio f # monogame
Dfctps
source share