• Stars
    star
    122
  • Rank 290,676 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple 2D gamedev examples using Blazor and .NET 5

BlazorCanvas

I started this project with the intention of learning/exploring what can be done with Blazor and 2d graphics. I am an old-time videogames lover and I always enjoyed coding small games and prototypes in my spare time.

The goal is to create small examples, built one on top of the other, showing how easy it is to render 2d elements using Blazor. Eventually I might end up writing a full game, it highly depends on how much time I'll have.

The repository is divided into numbered subfolders, each one with a single example.

Every example is also published on GitHub Pages via GitHub Actions using the approach outlined here . The master branch is used to host the published pages. The main branch is development.

There is a new library for 2D development with Blazor, Blazorex. Check it out!

Examples

I haven't yet updated all the examples to use Blazorex instead, but the base concepts are exactly the same.

  • Example1 shows how to initialize the 2d canvas
  • Example2 shows how to render a sprite and react to the window resize event
  • Example3 shows how to move a sprite on the screen
  • Example4 builds on top of the previous one, refactoring and cleaning up the code
  • Example5 shows how to handle mouse inputs
  • Example6 shows how to animate a sprite. Spritesheets were downloaded from here and combined using a custom tool
  • Example7 shows how to control animations using the keyboard
  • Example8 shows how to use a FSM to control animations and move the character on the screen
  • Example9 refactors the code and introduces the Scene Graph
  • Example10 adds the Assets Resolver
  • Example11 shows how to do collision detection

Tutorials

Every example will be explained in detail by an article on my personal blog:

More Repositories

1

SuperSafeBank

Sample Event Sourcing implementation with .NET Core
C#
565
star
2

OpenSleigh

OpenSleigh is a Saga management library for .NET Core.
C#
308
star
3

WebApiWithBackgroundWorker

Small demo showing how to implement Pub/Sub with a BackgroundWorker in .NET Core
C#
77
star
4

DDD-School

Implementation of the Outbox pattern to improve microservices reliability
C#
47
star
5

Blazorex

Blazorex is an HTML Canvas wrapper library for Blazor.
C#
43
star
6

EFCoreCommerceDemo

Small demo showing how to use DDD with Persistence Ignorance using Entity Framework Core 3.
C#
30
star
7

EvenireDB

small stream-based DB engine
C#
23
star
8

ChannelsExample

small example of how to implement Producer/Consumer in .NET Core using System.Threading.Channels
C#
22
star
9

chip8-emulator

Simple Chip8 emulator written in C# with .NET5.
C#
18
star
10

MongoDbIntegrationSample

small example of how to write integration tests on MongoDB with .NET Core
C#
18
star
11

BlazorChat

sample chat application written with Blazor and ASP.NET Core
C#
17
star
12

Blazeroids

Blazeroids is a 2d space shooter implemented using Blazor and .NET.
C#
15
star
13

BlazorOnGitHubPages

HTML
14
star
14

BlazorBackgroundTask

small sample showing how to run a background task and display the status in a Blazor app
HTML
14
star
15

BlazorWPBlog

Sample Blazor Webassembly application showing how it's possible to build a blog using Wordpress as data source
HTML
10
star
16

BlazorAndDragons

D&D 5e API client written in .NET Core with Blazor and GRPC
C#
9
star
17

BlazorHttpResiliency

example showing how to improve resilience in a Blazor webassembly application using Polly
C#
7
star
18

BlazorRoguelike

C#
7
star
19

cross-cutting-concern-attributes

C#
7
star
20

AzureLongRunningProcess

Sample template for long-running processes on Azure using Durable Entities
C#
6
star
21

AngularJs-Pagination

JavaScript
6
star
22

ConwayBlazor

simple implementation of Conway's Game of Life using Blazor
C#
6
star
23

8080-emulator-net

C#
5
star
24

isolator

Small example of how to execute code in a separate AppDomain
C#
5
star
25

parallel-tasks-exceptions

C#
5
star
26

parallel-tasks

C#
4
star
27

LibCore

base set of libraries and utilities for web applications development
C#
4
star
28

GlyphEngine

2D Game Engine based on XNA
C#
4
star
29

CICDIntegrationTests

How to handle integration tests in a CI/CD pipeline
C#
4
star
30

BlazorImageUpload

simple application showing how to upload images with Blazor Server to an Azure Blob
HTML
3
star
31

BenchmarkDynamicInvocation

C#
3
star
32

DynamicConfig

C#
3
star
33

CastleLegends

C#
2
star
34

random-dungeon-generator

C#
2
star
35

MongoLocks

small demo showing how to lock a document on MongoDB with .NET Core
C#
2
star
36

wp_sass

How to use SASS with Wordpress
JavaScript
2
star
37

hex-map

XNA Hexagonal Map Renderer
C#
2
star
38

AsyncServices

Sample repository showing how to handle requests asynchronously.
C#
2
star
39

Highway

THE PROJECT HAS BEEN MOVED
2
star
40

devdaychat

Simple chat application using RabbitMQ
HTML
2
star
41

WhoIsTheStrongest

simple example of how to use Azure Durable Entities to handle polls
C#
2
star
42

DictionaryLookupBenchmark

Benchmark of lookup performance between `Dictionary`, `SortedList`, `SortedDictionary` and `HashSet`.
C#
2
star
43

WebApiTestingSkeleton

A simple example of how to structure a .NET Core Web API project with tests
C#
1
star
44

heimdall

poor man's service discovery tool
C#
1
star
45

Solo

C#
1
star
46

collections-lookup

C#
1
star
47

react-nodejs-pagination

How to paginate data with NodeJS and React
TypeScript
1
star
48

azure-functions-healthchecks

C#
1
star
49

mizrael

1
star
50

UsersVoice-UI

project submitted by the Coders101 team at the Dell Limerick Hackathon 2016
JavaScript
1
star
51

MVC-Json-Model-From-Uri

MVC Value Provider for complex models in GET requests
C#
1
star
52

typescript_environment_setup

How to setup the environment to develop typescript client-side applications
JavaScript
1
star
53

XnaWinform

simple example of how embed an XNA renderer in a Windows Form application
C#
1
star
54

BlockingBackgroundService

C#
1
star