Code Monkey home page Code Monkey logo

arta2dengine's Introduction

Artanis 2D Engine

This Github repository contains my own Monogame 2D Engine.

Getting Started

In order to use this on your project, you need to either add the DLL as reference or add the whole solution inside your monogame project. In both cases you need to use the correct using statement in each file:

using Arta2DEngine;

Prerequisites

This engine uses Monogame 3.7.1. It might work on other versions, but it is not tested against any other than 3.7.1.

Installing

Simply clone this repository inside a folder of your choice with:

git clone https://github.com/Artanisx/Arta2DEngine.git

Then add the project to your solution, then add it (Arta2DEngine) as a reference to your main game project. You can find it in the "Projects" category of the Reference Manager window. Adding Arta2DEngine as reference

If you prefer to go with the DLL installation (so you don't need access to the Engine source code), you don't need to clone the project, you only need to download the latest release version of the DLL, put it inside your project folder and add it as a Reference, looking into the "Browse" category of your Reference Manager window.

Documentation

You can find the documentation clicking this link.

Tutorials

You can find the tutorials clicking this link.

Features

This engine has several basic features, like:

  • Game Object system, to deal with object like entities
  • 2D sprite functionality, including basic animation from texture atlases
  • Audio support for sound effects and music
  • A basic 2D camera system with pan, zoom and lookat functionality
  • A basic 2d primitives system to help with debugging and for collision checks
  • A basic system to handle collisions, thanks to automatically generated bounding boxes and circles using the Intersects method (and Contains for circles).
  • A basic screen manager system to handle multiple screens, like menu, gameplay and outro screens
  • A basic customizable Particle Engine system, with easily extendable effects
  • A basic UI system with buttons with easily generated events
  • A basic Input system built around a "command" object that can work with keyboard, mouse and gamepad

Copyright and License

Arta2DEngine is released under GPL v3. You can read it here.

Built With

Authors

Extra Credits

During the development of Arta2DEngine I've studied tutorials and source codes from several different sources. Below the list of the ones I specifically recall at the time of writing:

If I forgot any contribution for the Extra Credits section, please send me a message!

arta2dengine's People

Contributors

artanisx avatar

Stargazers

 avatar

Watchers

 avatar  avatar

arta2dengine's Issues

Implement an empty Update() method inside the BaseObject class and implement one in GameObject

With an empty virtual void Update() method in the baseobject class we make sure we can call Update() to all object (wheter they have an implementation or not) ensuring compatibility with foreach and the like.

Then implement a basic Update() method inside GameObject that uses Velocity to update the position of the GameObject. Consider if it's needed to add a further speed float to further modify it like Velocity * speed (or for instance to quickly stop an object from moving with speed = 0).

Enhance the Particle Engine plotting a way to define "Emission Types"

Currently the Particle Engine only has one way to emit particles, the default GenerateNewParticle() method.

Devise a system to accept ParticleEmissionType so that one could configure his own "GenerateNewParticle()" methods iniside a separate ParticleEmission file (implementation of ParticleEmissionType) and then make the ParticleEngine constructor accept that file:

// Example
particleEngine = new ParticleEngine(textures, SmokeParticle(),Vector2.Zero);
particleEngine2 = new ParticleEngine(textures, SparksTrail(),Vector2.Zero);

Create a InputHandler

The input handler will take care of creating Commands and updating them.

For example

// Create a InputHandler
InputHandler inputHandler = new InputHandler();

// Setup the GamepadX that will fire once
gamepadX = new Command(Command.GamepadButton.X);
gamepadX.SinglePress += GamepadX_SinglePress;

// Add commands
inputHandler.AddCommand(gamepadX);

// Update ()
inputHandler.Update(gameTime);

Mainly the inputHandler would take care of storing a list of commands and to update them all.

public void InputHandler.Update(Gametime gameTime)
{
   foreach(Command command in Commands)
   {
      command.Update(gameTime);
   }
}

Consider adding a Gamepad vibration helper module.

Adding a module that contains some helper methods for the vibration.

GamePad.SetVibration(PlayerIndex.One, newGamepadState.Triggers.Left, newGamepadState.Triggers.Right);

For instance something that can vibrate both rotors for a given time or strenght:

// Vibrate for 5 seconds
Gamepad.Vibrate(5f);

// Vibrate for 5 seconds with intensity 0.4
Gamepad.Vibrate(5f, 0.4f);

Add to the Command.cs support for Gamepad analog input for Thumbstick and Triggers

At the moment the Command.cs module do not support the analog input from Thumbstick and Triggers.

Add this. For example:

// Move Kokichi with thubsitck
float maxSpeed = 10.0f;
Vector2 thumbMove = new Vector2 (newGamepadState.ThumbSticks.Left.X * maxSpeed, newGamepadState.ThumbSticks.Left.Y * maxSpeed * -1.0f);

kokichiPos += thumbMove;

// Use lefttrigger to do change kokichi scale
kokichiScale = newGamepadState.Triggers.Left + 1.0f;

// vibrate left and right rotors with triggers
GamePad.SetVibration(PlayerIndex.One, newGamepadState.Triggers.Left,      newGamepadState.Triggers.Right);

Create Command : Keyboard and Command : Mouse subclasses

Currently Command.cs deals with both Keyboard and Mouse events with an hybrid solution of two constructors.

It would be better to make the Command class abstract and then create two subclasses: Keyboard (with the current keyboard constructor and dealing with keyboard events) and Mouse (with the current mouse constructor, dealing with mouse events).

Move all Basic Engine Code to the Arta2DEngine

In my current Monotest project I have some basic functionality (Particles, Sounds) that should be moved to here.

It's all very basic, but I think that doing the next tutorials and learning Monogame using my Arta2DEngine as a base (and creating new engine related tasks directly inside it) is going to be good to start building its foundations.

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.