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

learn more… | top users | synonyms

0
votes
1answer
25 views

MonoGame-based animation system fails to change animation [on hold]

We have a problem with the animation. The problem is that it won't play the right animation. We are using a spritesheet with 4 frames: idle, movement and so on. Here's the code we are using: class ...
0
votes
1answer
40 views

How would I handle collision to all instances of one object? (C# and monogame)

What I'm saying is, let's say I have a list. That list contains all the tiles in the game. I use this to update them all, draw them all, etc. for (var i = 0; i < Tiles.Count; i++) { ...
-1
votes
1answer
59 views

Bullet only removing closest enemy

I'm having an issue with my collision detection code. I'm making a top down shooter and when I shoot, the bullet will only destroy an enemy if it's the closest enemy. The bullet will go right through ...
1
vote
1answer
57 views

Check collision with rectangle and pixels

I have done a function to check the pixels collision against two animated sprites, and now I need to check a "Rectangle x animated sprite" collision, but I have no idea how to do this. I tried to ...
0
votes
0answers
16 views

Illegal characters in Path: Error while building SpriteFont MonoGame 3.4

I used XNA for a long time everything was working fine, but now with the new MonoGame thing they added a GUI for Content Managing, and I found it pretty cool but it doesn't work like intended. I'm ...
0
votes
0answers
23 views

How can library classes access SpriteBatch?

I have a spritebatch in my primary game component in a game project: public class GameRoot : Game { private SpriteBatch mySriteBatch; public SpriteBatch MySpriteBatch { get { return ...
0
votes
1answer
40 views

Mode 7 in xna/monogame

I want achieve a view like Mode 7 from snes games where the closer textures get stretched out more and more far away textures look smaller. Something like this: What I have in my project at the ...
0
votes
0answers
35 views

Difficult to implement Microsoft XNA Platformer Example Enhancement

I implemented the platform logic from the XNA Platformer Example, but it have few annoying bugs, like this one: I wasn't able to fix it by myself, so I searched a lot and found this question: ...
3
votes
1answer
71 views

Problems with converting from Screen Space to World Space

I have an unproject function I've written, which takes in x and y values between -1 and 1, and a z value between 0 and 1 (0 is near plane, 1 is far plane). I create a vector off of this, and multiply ...
1
vote
0answers
24 views

Farseer Engine Texture To Polygon Center of mass bug

I am new to Farseer Engine used with MonoGame so I decided to do some test with the API to see the results and learn. If I understand, in Farseer the Position property of a Body object is located at ...
1
vote
1answer
52 views

Monogame scale/resizing texture without stretching the borders

I would like to scale or resize my texture2d but when I do it, the texture border becomes stretched. Here's an example : This is my original texture And this the texture after I change the Scale: ...
1
vote
2answers
129 views

Can I make this physics simulation any faster?

I've made a little real time physics simulation that solves some bodies. CirclevCircle && CirclevOrientedRect I would like someone to tell me if I'm doing something drastically wrong. I know ...
1
vote
1answer
59 views

How to fix my camera collision, C# XNA

I am having some weird issues with my camera. I am trying to make it so it is a first person camera, that when the user presses the W or Up key, it moves towards where the camera is looking. My issue ...
0
votes
2answers
82 views

Is it possible to trigger a loop with key input

Ok I need to know if it is possible to trigger a gameloop with a key press? ex code if (GamePad.GetState(PlayerIndex.One).Buttons.X == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Up)) ...
0
votes
0answers
14 views

Writing a VB Template

As I'm having all these problems with Fonts and Sounds basically not working at all in the XNA template I found for VB, I'm thinking of trying to convert over to Mono. So, two questions I suppose; ...
0
votes
2answers
83 views

Best way to draw 2D shapes on a 3D flat object

I want to draw shapes (arcs, circles, lines) on a table, which is in 3D space. The table top is at Y=0 level and oriented so it points to (0, 1, 0). There are some other 3D objects on the table, so ...
0
votes
0answers
18 views

Error loading MonoGame Fonts

I'm getting to the end of transposing the MonoGame Asteroids tutorial app to VB, all going very well until I got to the font. I would assume the VB Syntax would be myFont = Content.Load(Of ...
1
vote
1answer
24 views

MonoGame, sprite to rectangle

I'm bucking the trend and working with MonoGame in VB2015, please don't tell me how brilliant C# is and how I ought to learn that, I really can't be bothered, and all the }}{}{{{}{ drives me insane!! ...
0
votes
0answers
25 views

Monogame Vertex Shader Hassle

I'm currently creating a game in Monogame 3.4. I've written a relatively simple pixel shader in HLSL which works perfectly fine under Windows DX. When I use the same shader under Linux (OpenGL), ...
1
vote
0answers
33 views

SignalR Monogame Lag

I'm creating a C# multiplayer game in Monogame using SignalR to update the enemy players positions. This is my proxy.invoke: proxy.Invoke("UpdateEnemy", LocalShip.Position, ...
0
votes
0answers
32 views

Shader that only shows edge of textures and hides rest

I'm wondering if anyone has a name for this type of shader, has an example of how to do it, or can point me in the right direction for creating one. This is a picture of the no shader / wanted ...
1
vote
1answer
38 views

scaling problem with some resolutions

So I made a scaling system for different resolutions, and I got very weird results. I have an old "scaling" system where you can choose which scaleSize you want (for testing with the old 800 x 450 ...
0
votes
1answer
37 views

Automapping of the noise texture onto 3D model

I want to apply kind of noise/dust texture to objects so it would look good, and make it without having UV mapping in models. This is because I want to have a possibility to apply this to any objects, ...
3
votes
3answers
65 views

MonoGame - Ordering Movement Key Presses

I'm looking for a way to retrieve the last key pressed even when other keys might be pressed for a top-down four-directional game. For example: W is pressed → Move up D is pressed → Move ...
0
votes
2answers
83 views

Monogame resolution problem (without scaling sprites)

So I'm working on a project and started working on a scaling system for different resolutions. I know if you change the monogame resolutions, that the texture won't scale but I noticed deformed ...
0
votes
0answers
46 views

Custom game loop entirely in the Update method

I am attempting to implement a custom game loop in XNA/Monogame. I know that one can re-implement the Game class using WinForms (with the caveat of having to also redo the content manager, etc.). I ...
0
votes
0answers
30 views

How to use OpenTK (OpenGL) with MonoGame?

So I've been making a snake game using MonoGame (DirectX Only). I added movement, controls, feeding and growing in length. I wanted to add smooth animations to the game because the snake is just made ...
1
vote
0answers
32 views

Can't play sound in Monogame

I'm new in monogame so I have some problem with play sounds in my game. I have a variable: SoundEffect _soundEffect; In LoadContent() method I'm doing this: _soundEffect = ...
0
votes
1answer
50 views

Monogame - NullReferenceException on Exit();

I'm currently attempting to learn the Monogame system. I have little prior experience in C# (about two weeks of XNA, four years ago) but am reasonably familiar with VB.NET. Essentially, when calling ...
3
votes
0answers
65 views

No collision with CompoundPolygon Monogame/Farseer

I want to create a body based on its texture. But the body I created just falls through the floor instead of colliding and resting on it. My Code: using FarseerPhysics; using FarseerPhysics.Common; ...
1
vote
1answer
37 views

HLSL pixel inside a view (cascaded shadowmapping)

I'm figuring out shadowmapping in HLSL (see also this question). I understand that I need projection matrices for each cascading shadowmap. I use this code to create the projections: Matrix ...
1
vote
1answer
66 views

MonoGame does not generate xnb from png

I am coming straight from XNA and I installed the latest version of MonoGame today (2015-12-22) for Visual Studio 2015 Community. I created a project from the windows Project template. I right ...
1
vote
1answer
68 views

HLSL Shadowmap shader for large scale environments

I'm working on a racing game in Monogame. The game runs fine so far using Monogame's BasicEffect (link to video). I wanted to add shadows so I implemented a shadowmap using this as a base. and a ...
4
votes
2answers
55 views

Monogame project runs in VS but hangs when run via .exe

I've been working on a monogame project for a little over a week and had no problems. Today I went to test out the project outside of Visual Studio, by running directly from the .exe in the release ...
0
votes
1answer
32 views

How to draw a sprite at a floating point xy coordinate with interlaced drawing?

I have a 2D game made in MonoGame (XNA 4.0 framework). Here's what I want to do: draw a 2d image at a floating point xy coordinate such as 125.5, 300.12 (and do NOT round them to an int). the image ...
1
vote
0answers
41 views

OpenTK crashes with Mono

I've implemented OpenTK as a secondary renderer which would let me support Mac/Linux only to realize that for some reason, even without any modifications (new MonoGame project), the application would ...
0
votes
1answer
73 views

In Monogame, why does Rectangle.Offset not work?

I have the following code in a default Monogame Game project: protected override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Left)) { ...
0
votes
0answers
42 views

XNA 2D position offset

I am creating a 2D game engine with XNA and MonoGame. For each of my sprites I have offset positions, which I use to align another sprite if is it not within the main sprite i.e. stance. I have an ...
1
vote
1answer
40 views

MonoGame.Extended Exception when loading a TMX file

I'm getting a strange exception when trying to load in a .tmx file using MonoGame.Extended. I can load the same .tmx file into other 3rd party libraries (tried to recreate the error) without any ...
1
vote
2answers
115 views

How to restart the game when pressed enter in XNA

If the following code allows the game to exit when pressed esc .. if (gamePad.Buttons.Back == ButtonState.Pressed || keyboard.IsKeyDown(Keys.Escape)) { this.Exit(); } Then this code should ...
7
votes
2answers
209 views

2D A* Path-Finding

I have this problem, which isn't really a problem, but I feel like it's some sort of glitch in my code maybe. My pathfinder, to find a path from A to B, does this: which is almost fine, it works ...
2
votes
1answer
36 views

XNA/Monogame Change SpriteBatch Blendstate in between calls

I'm working on polishing up the particle system in the project I'm working on in Monogame. Currently particles and objects are all drawn within the same Begin/End block to allow for FrontToBack depth ...
-2
votes
1answer
130 views

increase and decrease coin count

I am working in coin system. if the player get the coin it adding to +1 coin. after game over i want to store the coins. if the player again earn coin means the new coin want to add with existing ...
0
votes
0answers
26 views

Monogame with Visual Studio Shared Project

I want to create a Monogame game for Windows Desktop and WinPhone8 (and eventually for others platforms), so I've created on Visual Studio 2015 (Pro version if it concerns) a shared project where I've ...
2
votes
1answer
77 views

Calculating rotation matrix for an object relative to a planets surface in MonoGame

I have a 3D planet and I would like to place models on the planet and have them start with a base rotation relative to the planet surface at their location. So a model at the north pole will have zero ...
1
vote
0answers
76 views

How should I store battle effects?

I have battle effects that can be anywhere from 50-150 frames (running at 60fps). I need to be able to draw each frame of the battle effect as an additive layer onto my game. A frame could look ...
0
votes
1answer
43 views

Blender model doesn't show up in monogame

I have a problem getting blender models to show in monogame on windows. Using latest monogame 3.4, fresh blender 2.76b, developing in Visual Studio 2010 using OpenGL Monogame template. What I'm ...
2
votes
1answer
50 views

Multiple overlapping rectangles

I have a collision method where the parameters for the method are the rectangle of the player and a list with the rectangles of the tiles. I work with booleans like bLeft, bRight,... and this ...
2
votes
1answer
33 views

Collision method only using one item from list

I've made a temporarily method for collision with all the blocks on the screen. (I used almost the same method in the past, but only for one block at the time.) So I start in the Sprite class. I use ...
0
votes
1answer
71 views

MonoGame Pipeline

I've been having some problems with the pipeline in MonoGame. I'm using Visual Studio Community Edition 2015 with MonoGame 3.4. I used the installer rather than NuGet if that helps with the problem. ...