Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple 2D gamedev examples using Blazor and .NET 5

License

NotificationsYou must be signed in to change notification settings

mizrael/BlazorCanvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 outlinedhere .Themaster branch is used to host the published pages. The main branch isdevelopment.

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 fromhere and combined usinga 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 mypersonal blog:

About

Simple 2D gamedev examples using Blazor and .NET 5

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

[8]ページ先頭

©2009-2025 Movatter.jp