Animal 1.0.0

dotnet add package Animal --version 1.0.0
                    
NuGet\Install-Package Animal -Version 1.0.0
                    
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="Animal" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Animal" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Animal" />
                    
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 Animal --version 1.0.0
                    
#r "nuget: Animal, 1.0.0"
                    
#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 Animal@1.0.0
                    
#: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=Animal&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Animal&version=1.0.0
                    
Install as a Cake Tool

Animal - MonoGame Utility Library

Animal is a versatile and modular library designed to help you with common tasks when creating games in MonoGame. It provides reusable components and patterns to save time and improve the development process. Whether you're creating a game from scratch or need specific features to build upon, Animal is a great starting point for MonoGame developers.


Features

1. Cameras

  • Camera

    • A simple Camera class to manage the game's camera system.
    • UpdateMatrices: Updates the camera's view and projection matrices.
    • GetZFromHeight(float height): Calculates the Z-coordinate based on the height.
    • GetHeightFromZ(float z): Calculates the height from a given Z-coordinate.
    • MoveZ(float amount): Moves the camera along the Z-axis by the specified amount.
    • ResetZ: Resets the camera's Z position to its original value.
    • Move(Vector2 amount): Moves the camera by the specified amount.
    • MoveTo(Vector2 target): Moves the camera to a target position.
    • IncZoom: Increases the camera's zoom level.
    • DecZoom: Decreases the camera's zoom level.
    • SetZoom(int amount): Sets the zoom to a specific value.
    • GetExtents: Returns the camera's current width and height, as well as the extents (left, right, top, bottom) of the camera's view.
    • OnResize: Updates the camera when the window is resized.
  • Follow Camera
    Inherits from Camera, and allows the camera to follow a target (smoothly or with boundaries).

    • FollowSmooth: Smoothly follows a target inside a specified window size and boundary.
    • LeadPlayerSmooth: Predicts the player’s movement direction and smoothly follows the target with an offset.
  • Y-Sort Camera
    A camera that sorts sprites based on their Y-position for proper rendering order.

    • Draw: Draws sprites in order of their layers, ensuring correct rendering.

2. Enums

  • DirectionEnum: Enum for cardinal directions (Down, Up, Left, Right).
  • WindingOrder: Enum for determining the winding order of polygons (Invalid, CounterClockwise, Clockwise).

3. Events

  • KeyEvent: For handling key events and subscriptions.
    • Action: Action triggered by the key press.
    • Key: The specific key that triggers the event.

4. GameObjects

  • Player

    • PlayerBase: Provides a baseline for player functionality.
    • Player: Handles movement and running.
      • Move: Updates player position based on movement direction.
      • Run: Updates the player's speed based on the run factor.
    • AnimatedPlayer: Inherits from Player, and handles player animation based on movement distance.
  • TileMaps

    • TileMap: Manages tile maps and layers.
      • Draw: Draws tiles within a specified viewport.
      • IsTileType: Checks if a tile at a specific position matches a given type.

5. Graphics

  • DrawScreen: Draws a screen inside the window.
  • DrawShapes: Provides utilities for drawing shapes and polygons.
    • Polygon triangulation can be calculated using Vector2[] vertices.
  • DrawSprites: Draws Texture2D sprites.

6. Handler

  • KeyboardHandler
    • Integrates with the InputManager for handling key input.
    • AddKeyBind: Adds a key binding event.
    • RemoveKeyBind: Removes a specified key event.
    • Update: Updates key input states during the game loop.

7. Managers

  • Abstractions
    • InputManagerBase: Base class for the InputManager.
  • AnimationManager: Handles animation logic and frame progression.
  • TileMapManager: Manages multiple tile map layers.

8. Models

  • MapLayer: Contains information about a tile map layer (e.g., if it is collidable).
  • Sprite: A base class for sprite information used in drawing.

9. Structs

  • Boundary: Defines the bounds (max and min) for an object.
    • BoundaryClamp: Ensures an object is within the defined boundary.
  • Matrix2D: A simplified 2D matrix class, can be converted to a regular Matrix.
  • MovementDirection: Represents the direction an object is moving in, and stores the last movement direction.

10. Wrappers

  • BoolWrapper: Allows treating boolean values like integers (1 for true, 0 for false).

11. VectorMath

  • LinesIntersect: Checks if two line segments intersect.

Installation

You can install Animal via NuGet:

dotnet add package Animal
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 139 11/23/2024