endlesstravel / Love2dCS

C# Wrapper for LÖVE, a 2d game engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we use fsharp for this?

rishavs opened this issue · comments

Hi

I am new to the dotnet ecosystem. But can I use fsharp + dotnetcore 3.1 for your lib?

commented

yes. even, I've never used F#, but it's the same runtime(.net runtime), so i think it will work on it.
I used autocomplete to complete the program:
image

  1. add Love2dCS nuget
  2. just use the library

Thanks. I can confirm it is working for me too.

Here is my Programs.fs

namespace MyGame

module Program =

    open System
    open Love

    [<EntryPoint>]
    let main argv =
        Boot.Init();

        Boot.Run(Game());
        0 // return an integer exit code

and this is my Game.fs

namespace MyGame

open Love

type Game () as __ =
    inherit Scene()
 
    // override this.Load() =
    //     // TODO: Add your initialization logic here
        
    // override this.Update () =
    //     // TODO: Add your update logic here

    override this.Draw () =
        // TODO: Add your drawing code here
        Graphics.Print("Hello, World!", 400.0f, 300.0f);

Thank you. this is great!