https://github.com/3mam/polysnake
2d game write from scratch in .net 6
https://github.com/3mam/polysnake
blazor dotnet opentk
Last synced: 11 months ago
JSON representation
2d game write from scratch in .net 6
- Host: GitHub
- URL: https://github.com/3mam/polysnake
- Owner: 3mam
- License: mit
- Created: 2022-01-03T17:45:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T10:05:23.000Z (over 2 years ago)
- Last Synced: 2025-04-13T12:12:57.724Z (about 1 year ago)
- Topics: blazor, dotnet, opentk
- Language: C#
- Homepage:
- Size: 1.44 MB
- Stars: 10
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Polygonal Snake
[](https://github.com/3mam/PolySnake/actions)
[](https://elaborate-lily-2c0859.netlify.app)

## [live demo](https://elaborate-lily-2c0859.netlify.app)
Project goal is write from scratch 2D Snake in **.net 6**.
This project contains port for Blazor Server and Webassembly.
I adding Blazor for proof of concept. Game on Blazor don't
works 100% same way like desktop version.
Weird problem is with floating-point numbers. Is behave differently
between Desktop and Blazor.
And this create some problems with proper calculation.
## Used for this project
- libraries:
- OpenTK
- OpenGL4
- tools:
- Rider
- Blender
## Supported platform
- Linux
- Windows
- WebBrowser (experimental)
## Keyboard control
| Function | Keys | |
|---------------|--------|------------|
| Menu | Escape | |
| Option Up | W | ArrowUp |
| Option Down | S | ArrowDown |
| Accept Option | Space | Enter |
| Turn Left | A | ArrowLeft |
| Turn Right | D | ArrowRight |
## Install and run
### Download code.
> git clone https://github.com/3mam/PolySnake.git
> cd PolySnake
### Run desktop version.
> dotnet run --project Poly
### Run browser version.
Blazor server.
> dotnet run --project BlazorServer
In browser go to this url.
> https://localhost:5267
Blazor webassembly.
> dotnet run --project BlazorWasm
In browser go to this url.
> https://localhost:5249
## Build
> cd Poly
For Windows.
> dotnet publish -c Release --runtime win-x64
For Linux.
> dotnet publish -c Release --runtime linux-x64