Questions tagged [monogame]

Open-source implementation of Microsoft's XNA 4, for Windows, Mac, Linux, Android, and iOS, among others.

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

I got some wierd bug while building TMX files in Monogame

Today I tried to implement tilemaps to my game that I'm developing on Monogame. Those tilemaps were created by using Tiled map editor. For implementing my tilemaps I used Monogame Extended. I ...
Code Watermelon's user avatar
0 votes
1 answer
65 views

How to change layer depth according to player location?

I would like to change the layer depth of objects, so that the player can go behind them. Right now it looks like this when the player is behind the object: The problem is that the layer depth doesn'...
Markus Vaittinen's user avatar
0 votes
1 answer
51 views

How to add gameTime to movement with acceleration and diagonal normalization?

I recently started rewriting my engine from scratch, because the old one was my first attempt and the structure was very messy. Everything has been going great, but now I'm being held back by some ...
Markus Vaittinen's user avatar
0 votes
0 answers
59 views

Ideas for how to attach meta data to an arbitrary sprite sheet?

I am currently messing around with monogame and creating some silly sprite based games. One issue I have is when I get sprites for OpenGameArt or any equivalent they are often in spritesheets in a ...
kiooikml's user avatar
  • 101
3 votes
0 answers
136 views

2D Tilemap Collision resolution in C#/MonoGame

A bit of context about my game: I'm nearly 2 years deep into development of my game called Cosmorists. It's programmed in C# using the .NET 7.0.11 framework, and MonoGame 3.8.1 game framework and it's ...
Stellar Roots's user avatar
0 votes
0 answers
228 views

How does Monogame achieve a target FPS?

So in monogame, in your Game1 class you can write something like this: ...
DrZ214's user avatar
  • 348
0 votes
1 answer
37 views

How to correctly position a set of cuboids based on a direction property in MonoGame

I am trying to create a map for my game using a list of cuboid sections that are defined like this: ...
Maxim Gershkovich's user avatar
0 votes
1 answer
64 views

Is there a simple way to find where our code is keeping references to disposed/pooled objects?

In our c# game we use object pools to store sprites once the Dispose() method gets called.Then when the Sprite.Create method gets called if a sprite is in the pool it gets depooled, cleared and ...
Matteo's user avatar
  • 15
0 votes
0 answers
189 views

How to make 3D particles in Monogame?

I have made a 2D game and right now I am converting it to a 3D game. All fine so far, only for the particles I had used the particles library from monogame extended but this library only supports 2D ...
codymanix's user avatar
  • 364
0 votes
1 answer
547 views

Drawing Sprites and Primitives with layers in MonoGame

I'm writing my own 2D engine using MonoGame and I want to be able to draw 2D primitives (using DrawPrimitives) along with sprites using SpriteBatch. But when I draw them, the primitives are always ...
DragonSpecter's user avatar
0 votes
1 answer
194 views

Problems with rotating Child Objects

I'm writing a Transform script for a Monogame project and I'm trying for a few days now to fix the Rotate method of this script, but without success. Currently, the Parent transform only rotates ...
NOrlYNcE's user avatar
1 vote
1 answer
208 views

D3D11 ERROR ("invalid arguments") from HLSL shader

I am using MonoGame 3.8.1.303 with Windows/DirectX. I am just rendering a TriangleList using DrawIndexedPrimitives, but I am ...
codymanix's user avatar
  • 364
0 votes
1 answer
63 views

correct matrix to draw mesh as flat object

I need to draw a tilemap for a 2d game. For that I created vertices with their relative positions already hard baked. The coordinates start top-left with (0f, 0f) and z is always 0. I rendered them to ...
codymanix's user avatar
  • 364
0 votes
1 answer
157 views

Monogame - When to reuse buffers?

So - how do these work exactly? Right now I am making a buffer and setting the data every frame for my object, but I heard you can reuse the buffer, too. If the object is not changing in any way ...
Lukas Kawalec's user avatar
0 votes
1 answer
178 views

How to modify single-scene ECS setup to support multiple local players in different scenes?

I'm currently developing a game in Monogame / C#. I have the underlying game engine set up in the following way: Entity/Component/System architecture A Scene includes a map, cameras, and a list of ...
Rich. T.'s user avatar
0 votes
1 answer
197 views

Apply bloom effect to RenderTarget without affecting UI

I'm currently rendering my whole game to a RenderTarget in order to stretch the scene to any resolution. I also have a bloom effect rendered with the scene. I'm now ...
Syll's user avatar
  • 11
0 votes
1 answer
472 views

Drawing Textured Quads

I've been starting to write some XNA / Monogame code lately, and wanted to draw a quad with a Texture2D attached to it. After searching the internet for a while, I've come up with this render code: <...
Mickey's user avatar
  • 1
0 votes
1 answer
47 views

Rotate and Zoom a group of tiles

I'm working on a tile-based game and I'm trying to rotate my tiles as a group around the center of the screen and want to have the ability to zoom in and out. Here my code: ...
Canox's user avatar
  • 103
0 votes
0 answers
197 views

Best way to implement a weapon/tool swing

In some games like Keplerth or Archvale, a weapon basically points towards the mouse and stays around the player sprite. But when you attack the weapon swings. I don't believe this is done with a ...
ajrao's user avatar
  • 1
0 votes
1 answer
64 views

Remove gaps between 2D trail that is based on particle engine

Hi I'm using a particle engine suggested from this answer I'm trying to create a seamless particle trail effect every similar to this (same) question However, when the vehicle is travelling too fast ...
web_dev_beginner's user avatar
1 vote
2 answers
654 views

Combining palette-swaps and smooth scaling in a pixel-art shader

I am creating a pixel-art game in MonoGame, and have written a shader to perform various effects on a sprite when rendering it, such as performing palette swaps, highlighting outlines, etc.. Most of ...
Bent's user avatar
  • 23
1 vote
1 answer
126 views

Best way to draw a tile (a floor) all over the screen?

I wanted a tip, a guidance perhaps to know the best way to draw a tile all over the screen. This tile is a 16x16 tile that should be the floor in my top-down map. I set my resolution to 1280x720 and i ...
Gabriel Ozzy's user avatar
1 vote
1 answer
77 views

Meshes seem to get distorted when I use rotate or zoom transforms (XNA/Monogame)

Whenever I seem to create a rotation matrix or try to zoom, the meshes that I draw to the screen get stretched and distorted. I've tried to make a simple rotation matrix like this: ...
Lukas Kawalec's user avatar
3 votes
1 answer
205 views

Proper way to build sensible object graphs?

The Context I'm currently working on a game and its engine using C# and MonoGame. The engine is data-driven and I want people to be able to mod the game or make their own using my engine. All the ...
sboutin4's user avatar
0 votes
1 answer
5k views

How to handle octave & frequency in the Perlin noise algorithm?

I would like to implement a Perlin noise algorithm into my MonoGame project in order to procedurally generate 2D terrain. I've been using engines in the past (Godot, mostly) where there was an API to ...
atrefeu's user avatar
  • 103
1 vote
1 answer
279 views

How can I get correct coordinates from a diamond isometric map created in Tiled?

I am rendering a diamond isometric map created in Tiled using Monogame.Extended.Tiled package. Here is where I'm trying to spawn a player with an object at ...
Emobe's user avatar
  • 11
0 votes
1 answer
111 views

Monogame - SpriteFont build error

I am quite new to Monogame. When I try importing a .spritefont file using the Monogame Pipeline GUI Tool and then build it, it gives me an error: "System.DllNotFoundException: Unable to load DLL '...
Dominicentek Gaming's user avatar
2 votes
1 answer
320 views

Floats vs. Ints for position and collision

So I’m writing a player class and using floats to store the positon and velocity (Vector2) as well as using it when drawing. When it comes to collision I get the player bounds using this code: ...
gamer1's user avatar
  • 65
1 vote
1 answer
110 views

Decouple shared data from consumers

I am a former Unity user, and after a big pause in game dev decided to try out Monogame (I'm a software engineer IRL so I'd figure this is the best way to go). In Unity I was using scriptable objects ...
TanguyB's user avatar
  • 161
0 votes
0 answers
171 views

How to mask 2D tile sprites

I want to use masking technique to be able to reuse tiles. Basically I have the base texture and an array of masking textures for different corners and positions and want to combine the two to get a ...
gamer1's user avatar
  • 65
0 votes
1 answer
2k views

Something goes wrong when using System.Diagnostics.Process.Start to open a Monogame project

I am trying to develop a menu application for a homemade arcade. However, when I use Process.Start(path) to open my monogame projects' ...
DubstepZedd's user avatar
1 vote
0 answers
118 views

How do I play multiple animations at once with an MonoGame skinned mesh?

I am working with the SkinnedMesh from this tutorial. I am at the point where I want to let my character run (which already works), but when I press the punch key on my keyboard, I only want the upper ...
x L u M i x's user avatar
0 votes
2 answers
170 views

How do I create an infinite tower

So I had this idea of creating a 2D game where the player would just climb a tower the furthest he could. I do already have a camera and a scene class somewhat ready, but I'm not sure how I would add ...
ECMiraldo's user avatar
0 votes
1 answer
124 views

Will a game made with .Net Desktop Development, be able to run on Windows' desktops?

I am new to making games (I have experience only with pygame), and I want to start creating with C#. I've found out that Monogame is a very good engine. On my way of setting up, in the part where I ...
LoukasPap's user avatar
  • 103
0 votes
1 answer
310 views

How to do topdown collisions properly?

I'm trying to achieve grid/tile based collisions like "a link to the past"; here is an article showing it off (sliding off the corners and such). I'm currently using this type of collision ...
MysteriousFruit's user avatar
0 votes
1 answer
118 views

How can I find the direction a sprite is moving?

I'm trying to get the direction a sprite is moving (up, down, left, right). My current approach is to get the x and y coordinates of the target and the sprite (the sprite is the thing that I'm trying ...
Beanicles's user avatar
1 vote
2 answers
153 views

Exported FBX to Monogame doesn't translate all meshes

I'm taking a crack at a minecraft clone in Monogame, and I am trying to get my model to render as it's shown in Blender 2.9.1. When I look at the model in Blender, it looks great. When displaying in ...
Bill Sambrone's user avatar
0 votes
1 answer
194 views

How to select a sprite with the mouse in c# XNA?

I'm attempting to create a chess game, for the movement I need to be able to click on a piece with the mouse, and then the square I'd like to move it to. Each piece on the board is a sprite, and I'm ...
jriley's user avatar
  • 1
0 votes
3 answers
175 views

How do I show only the level in monogame? [closed]

How do I remove the blue background shown here So that only the level is visible without making the sprites/map larger or the window smaller?
LionCatDev Studio's user avatar
0 votes
0 answers
59 views

Advices on multiplayer implementation

I am developing a top down shooter and my singleplayer is pratically finished so now I want to move on to develop multiplayer but I have some questions and I am seeking for some advices. In my game a ...
Fábio Pires's user avatar
1 vote
0 answers
180 views

Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist is as follows: ...
Pooper's user avatar
  • 23
0 votes
0 answers
76 views

how to order entities by their distance from 0 on the x axis

I'm creating an infinite runner game in which you control several characters at once. Right now when you press the spacebar, they all jump at once but, I want them to jump at separately, one after ...
yasko kai's user avatar
0 votes
1 answer
52 views

Complex mesh (created in Blender) is not overlapping when rendered in Monogame (XNA)

community. Just started playing with Monogame and stuck with a quite simple, but still unanswered issue, at least I couldn't find any answer. The model rendered in Monogame (XNA) is not overlapping ...
LaoR's user avatar
  • 101
1 vote
2 answers
343 views

How can I stop the ball from bouncing forever without changing the gravity?

I am using Monogame in Visual Studio 2019 and I need to find a method to make the ball that I fired with the cannon stop after bouncing from the ground, and while doing this, I have to not change the ...
ibrahim topçu's user avatar
0 votes
1 answer
1k views

How to detect Tilemap collisions with monogame extended?

So,I kind of figured out how to detect the collisions when the chracter hits a certain tilelayer(such as a wall).Right now it just just the tiles which should have collision and prints out "...
Sankhayan Bhattacharjee's user avatar
0 votes
1 answer
489 views

How to change the player character size in monogame?

So I made a new project, Loaded up the player sprite(16x16) but the player is too small(as compared to the level) How should I fix this? Here the code which loads the sprites and the levels(I am using ...
Sankhayan Bhattacharjee's user avatar
0 votes
0 answers
96 views

Monogame pipeline is throws exceptions when trying to build .tmx files

I have correct referenced the monogame extended pipeline dll file to the monogame pipeline the importers and processors of the .tmx file are not missing/unknown but when I try to build the it it ...
Sankhayan Bhattacharjee's user avatar
0 votes
1 answer
72 views

Publish to folder equivalent for a desktop GL project with visual studio Mac 2019

I'm not home so the only computer I have access to is a Macbook, and now I would like to see how I could pack up projects to export for various platforms. But when I build my project it only produce a ...
Louis BERTRAND's user avatar
0 votes
0 answers
124 views

Per pixel collision depth

I need to modify the code below to get the penetration depth from the per pixel collision and return it as a Vector2 to later apply it to the character position. ...
RickS.'s user avatar
  • 51
3 votes
1 answer
50 views

Spritebatch drawing the other way

I am drawing a rectangle using a emptytexture (1x1) and I use the following: ...
Alanus Ger's user avatar

1
2 3 4 5
16