Code Monkey home page Code Monkey logo

umbrellatoolskit3's Introduction

UmbrellaToolsKit

About

UmbrellaToolsKit is a game framework made with MonoGame for personal uses, however you can feel free to use it.

Get Started

Content pipeline

Inputs

namespace Project
{
    public class Game1 : Game
    {
        
        //...
        protected override void Initialize()
        {
            // inputs
            KeyBoardHandler.AddInput("interact", new Keys[] { Keys.Enter, Keys.X, Keys.Space });
            KeyBoardHandler.AddInput("exit", Keys.Escape);

            KeyBoardHandler.AddInput("up", new Keys[] { Keys.W, Keys.Up });
            KeyBoardHandler.AddInput("down", new Keys[] { Keys.S, Keys.Down });
            KeyBoardHandler.AddInput("left", new Keys[] { Keys.A, Keys.Left });
            KeyBoardHandler.AddInput("right", new Keys[] { Keys.D, Keys.Right });

            base.Initialize();
        }
        //...
    }
}

Sprites

Render an image

namespace Project
{
    public class Game1 : Game
    {
        //...
        var scene = _gameManagement.SceneManagement.MainScene;
        var gameObj = new GameObject();
        gameObj.Sprite = Content.Load<Texture2D>("Sprites/picture");
        scene.Middleground.AddGameObject(gameObj, Layers.MIDDLEGROUND);
        //...
    }
}

Aseprite

Aseprite is a pixel art animation software. You can import its files using the steps below:

using UmbrellaToolsKit;
using UmbrellaToolsKit.Sprite;
public class Player : GameObject
{
    //...
    public AsepriteAnimation Animation;

    public override void Start()
    {
        Animation = new AsepriteAnimation(Content.Load<AsepriteDefinitions>("Sprites/player_animation"));
        Sprite = Content.Load<Texture2D>("Sprites/player");
        //...
    }

    public override void Update(GameTime gameTime)
    {
        Animation.Play(gameTime, "walk", AsepriteAnimation.AnimationDirection.LOOP);
        Body = Animation.Body;
        //...
    }
    //...
}

TileMaps

LDTK

OGMO Editor

Physics

Actors and Solids

Grids

Behaviors

Components

Creating a new component:

using System;
using UmbrellaToolsKit;

namespace Project.Components
{
    public class HealthComponent : Component
    {
        [ShowEditor] private bool _isImmortal = false;

        [ShowEditor] public float HP = 10.0f;
        public bool IsAlive => HP > 0.0f;
        public static event Action<GameObject> OnAnyEntityDie;

        public event Action OnDie;

        public void TakeDamage(float damage)
        {
            if (!IsAlive || _isImmortal) return;

            HP = Math.Clamp(HP - damage, 0, float.PositiveInfinity);

            if (HP > 0.0f) return;

            OnAnyEntityDie?.Invoke(GameObject);
            OnDie?.Invoke();
        }

        public void BeImmortal() => _isImmortal = true;
    }
}

You can add your own components to any game object:

namespace Project
{
    public class Game1 : Game
    {
        //...
        var scene = _gameManagement.SceneManagement.MainScene;
        var gameObj = new GameObject();
        scene.Middleground.AddGameObject(gameObj, Layers.MIDDLEGROUND);
        gameObj.AddComponent<HealthComponent>();
        //...
    }
}

Behaviors Trees

Coroutines

Nodes

Particles System

Storage

How to build

umbrellatoolskit3's People

Contributors

elton999 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

umbrellatoolskit3's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.