Profile image

My Website that lets you Make Web Games in C# and Lua

10.7k Paper  3 days ago

Introducing...

Codetoy Logo

A website I built that let's you make web games in C#, Lua, and statically typed JavaScript (via AssemblyScript, which is a subset of typescript that compiles to wasm).

I recently had a friend try it out and let me tell you, he made some insane stuff. For starters he built this infinite procedural Wolfenstein style shooter, which you can check out here: https://codetoy.io/3f6632eb-b79c-4c44-aa93-8ea44dd1ffdb

It will take a like a whole 10 seconds to load since the playground is loading the entire C# runtime (.NET)! (if you get an error just click the play button again, and wait another 5 to 10 seconds)

Shooter Game

Craziest part is he did it in 177 lines of code!

He also built an entire CPU based renderer in C# which you can pan and look around with your mouse: https://codetoy.io/c064b137-8686-4329-b6b3-0dfb0aa45bfc

SDF Raymarcher

The Origin Story

Way back when I started playing SimplePlanes I decided I wanted to make games, long story short that is reallllllly freaking hard but along the way I discovered KhanAcademy's Computer Science program https://www.khanacademy.org/cs, which I highly recommend! But in short I remember wanting to make a game in KhanAcademy's website and finding it incredibly difficult. So I gave up and instead I tried recreating KhanAcademy's system and... drumroll... I managed to get it working! But it sucked lol (here is a demo of an early first attempt if you are curious).

So this time I am doing it again but this time with C# support. To give credit where credit is due, this is in part because that same friend I mentioned earlier hates JavaScript and only ever wants to code in C# for the rest of his life...

Anyway, I gave in to his suggestion and boy am I glad I did because not only did I figure out how I could add C#, I also figured out how to add Lua (with plans to switch to Luau very soon), as well as AssemblyScript! Which is a really cool new language since it can compile directly to WASM (Web Assembly)... which is basically the new way of running code in browsers and it is MUCH faster than plain old javascript (blegh).

So... heh, what should I do next? Maybe add multiplayer? I'm looking into adding multi file support and letting you record audio and play audio clips in games! The amount of voiceover games people will make oof... how tf am I gonna moderate this bro T-T !

But yeah, maybe I should add another language? Or I should I add WebGL support? So many possibilities haha. Oh also, if you read this far, there is a discord :P feel free to join I'll be posting updates as I release stuff https://discord.gg/tTquzrtNgN