Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3mam/polysnake
2d game write from scratch in .net 6
https://github.com/3mam/polysnake
blazor dotnet opentk
Last synced: about 2 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 (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-08T10:05:23.000Z (about 1 year ago)
- Last Synced: 2024-01-08T11:42:44.016Z (about 1 year ago)
- Topics: blazor, dotnet, opentk
- Language: C#
- Homepage:
- Size: 1.44 MB
- Stars: 9
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Polygonal Snake
[![Build status](https://github.com/3mam/PolySnake/actions/workflows/dotnet.yml/badge.svg)](https://github.com/3mam/PolySnake/actions)
[![Live demo](https://api.netlify.com/api/v1/badges/11156706-f6b1-41f9-95b9-8fcf7743fd31/deploy-status)](https://elaborate-lily-2c0859.netlify.app)
![Snake Screenshot](Assets/output.gif)## [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 BlazorServerIn browser go to this url.
> https://localhost:5267Blazor webassembly.
> dotnet run --project BlazorWasmIn browser go to this url.
> https://localhost:5249## Build
> cd Poly
For Windows.
> dotnet publish -c Release --runtime win-x64For Linux.
> dotnet publish -c Release --runtime linux-x64