Posts

Fixing our camera

Image
Want a video version? Till now our game had been showing like this: And This thing right here, showing the blue background along with the map is very ugly. So, in this tutorial we will be removing the background so that our game starts looking like this: And this looks much better The code and Explanation:

Tile map collisions

Image
 Tile map collisions: In the previous part  we finished up our tile map loader class. In this one we will be finishing up the tilemap collisions. Want a video version? The implementation: For the implementation of the tilemap I have used the object layer functionality of the Tiled editor. An object layer allows us to create shapes like rectangle(which we will be using for our collisions), polygons, etc. The rectangles created by us are they passed on into a list of rectangles from which we can then check  if our player is colliding with one of them. The Code:

Loading the tile map

Image
 Tile Maps: What is it? "Tilemaps are a very popular technique in 2D game development, consisting of building the game world or level map out of small, regular-shaped images called  tiles . This results in performance and memory usage gains — big image files containing entire level maps are not needed, as they are constructed by small images or image fragments multiple times."                                                                                         - From developer.mozilla.org   In This tutorial we will be using the Tiled Map Editor I will not be showing how to use it or anything there are lots of resources for that. You can use your own tilemap but just in case you want to use the one I will be using  Here it is Want a video version? The Text version: The Code and Explanation: The Tilemap manager class: The Game1 class:

Making the Player Class

Image
 The Player Class: What does it contain? It contains all the functionality of the player. This includes(but not limited to) movement, animation, powerups, health, etc. The Player class: After this you got to call the Load function of your player class from the load function of your game1 class. The update function of your player class from the update function of your game1 class The draw function of your player class from the draw function of your game1 class.

Introduction

Image
  Making a RPG In Monogame Introduction: In these tutorial series I will be teaching you the process of making a simple rpg with monogame, monogame extended and c#. By the end of this you will have now only a fully working game but also a fully functional game engine which then you can use according to your needs. Want to try out the game before following the series? Download it from here   (the game is not yet completed I need to add the enemies) Prerequisite: For this tutorial I will be assuming that: 1.You already know some amount of C# 2.You have already set up your favorite ide with monogame and are looking for some tutorials to get started If you are an absolute beginner in coding (or in c#) then Here are some useful websites which you should look through before starting 1. C# tutorials 2. Monogame docs 3. Monogame Extended docs Software/Tools I will be using: 1.  Tiled map editor(For the tile map) 2.  Sprite Factory(For making our life easier while making the animations) 3.  Til