Mtf.Games 1.0.5

dotnet add package Mtf.Games --version 1.0.5
                    
NuGet\Install-Package Mtf.Games -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mtf.Games" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mtf.Games" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Mtf.Games" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mtf.Games --version 1.0.5
                    
#r "nuget: Mtf.Games, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mtf.Games@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mtf.Games&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Mtf.Games&version=1.0.5
                    
Install as a Cake Tool

Mtf.Games

A lightweight, custom C# 2D game engine and arcade game collection. Built on bespoke rendering (Mtf.Drawing) and input abstractions, this framework is designed to make implementing classic 2D arcade games fast, modular, and intuitive.


Included Games

CircleEater

An Agar.io-style survival game where the player controls a circle and must consume wandering enemy circles to grow.

  • Objective: Consume all enemy circles (default: 15) on the canvas to win.
  • Rules: You can only eat circles smaller than your current size. Every time you consume an enemy, your circle's radius increases.
  • Game Over: Colliding with an enemy circle that is larger than your player circle.

Snake (Wormy)

A custom take on the classic snake game, built visually using connected circle primitives (CirclePrimitive).

  • Objective: Navigate the canvas to consume randomly generated food, score points, and grow your worm.
  • Rules: The worm grows longer based on the randomly generated nutritional value of the food consumed.
  • Game Over: Colliding with the screen boundaries or the worm's own body. The player wins by reaching the maximum score (1000 points).

Architecture Overview

The framework relies heavily on dependency injection and specific interfaces to keep the game logic completely decoupled from the rendering and physical input layers:

  • GameEngineBase: The core abstract class managing the primary GameLoop(), pause states, frame pacing, and game-over/victory sequences.
  • IGameContext: An aggregate interface combining ICanvas, IInputContext, IAudioContext, and IApplicationContext. It provides everything a game instance needs to interact with the host system.
  • ICanvas: Handles the physical dimensions of the screen and the rendering of shapes (like CirclePrimitive and TextPrimitive).
  • IInputContext / IButtonStates: Abstracts keyboard or controller inputs into simple, readable boolean checks (e.g., IsUpButtonPressed()).
  • IMoveable & IDirectable: General interfaces for standardizing movement and directional heading for entities.

Getting Started

To run or extend this project, you need a .NET environment that implements the required UI/rendering frontend (e.g., WinForms, WPF, MonoGame, or a custom display matrix) mapping to the Mtf.Drawing abstraction.

  1. Implement the IGameContext interface in your host application to handle drawing and input.
  2. Instantiate either CirclesGameEngine or SnakeGameEngine, passing your custom context into the constructor.
  3. Call .GameLoop() to start playing.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Mtf.Games:

Package Downloads
Mtf.Lego.Mindstorms.EV3

Library for interacting with Lego Mindstorms EV3 robots.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 42 6/6/2026
1.0.4 54 6/4/2026
1.0.3 51 6/4/2026
1.0.2 89 5/31/2026
1.0.1 83 5/31/2026