XNA is a game framework by Microsoft that allows deployment for Xbox Live Indie Games as well as Windows Phone 7.

learn more… | top users | synonyms

0
votes
1answer
31 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
28 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: ...
0
votes
0answers
17 views

Custom bitmap font in XNA 4

Hy, brains. I'm making custom bitmap font processor and have a trouble with correct rendering. In details I have a font presented as png tile map with white characters on magenta background and I draw ...
0
votes
0answers
42 views

Problem with collision detection also affecting collision resolution

Hi I am making a 2d scrolling beat em up, I am working on the collision with obstacles like drums and platforms. So far I have the player jumping and falling from platforms but having problem ...
1
vote
1answer
58 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
78 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
2answers
52 views

XNA's GameTime.ElapsedGameTime.TotalSeconds isn't working as expected

As I've seen at quite a few website, the best way to handle variable frame rate and movement (moving projectiles, monsters, swinging swords)... looks something like this: //This position += ...
1
vote
1answer
64 views

How do I make 2 players from one Class?

I am teaching myself XNA and only started a few days ago. I am making a clone of Pong and have made a class for the Paddle: I am wondering how I can create 2 paddles one for each player from the ...
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
1answer
53 views

Why my game is running slowly if it was launched from a wpf application?

i have some issues why my GameEditor. I would start my XNA project from it, like a debug-client. It opens and all works fine, but it runs on 45 frames until I hide the wpf form. then the framerate ...
0
votes
2answers
39 views

Calculate ticks for animation delay

Hi guys I am trying to calculate the correct elapsedTime for each frame in my animation. Example I have a sprite called stance that has 20 frames I want to give each frame a tick delay property that ...
0
votes
4answers
74 views

using loop to detect collision in XNA

Got a problem, with collision detection, I need to detect collision between bullets and meteors using nested loop for this, but it isn't working. } } ...
1
vote
1answer
59 views

Relation between game systems and components in a component-based architecture?

Based on a question I previously asked here regarding to decoupling input from other components of an entity I developed a small component architecture on top of XNA to understand how everything works ...
1
vote
1answer
44 views

Multitexturing depending on given variables?

Im having trouble with rendering multiple textures. Using XNA gamestudio: working with 3D meshes and texturing. Effect.fx HLSL I do have a map/level that loads from a heightmap. - This works I have ...
-1
votes
1answer
61 views

XNA collision detection between Lists

I have 2 lists, one is for meteors and second is for bullets. I have problem with collision detection between them, this is my code for meteor spawning: public void LoadMeteors() { ...
1
vote
2answers
60 views

XNA makes the console flicker

I create a Window XNA game project from the template in Visual studio 2015. Then I right click and set the property to console application because I think it is convinient to use Console.WriteLine() ...
0
votes
0answers
45 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
23 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
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
64 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 ...
0
votes
1answer
34 views

XNA Texture2D Copy Error

I have a static class that I use to build a 3d character and render the results to a RenderTarget2D which I then return. I'd like to store the results for later use so I need to make a copy of the ...
1
vote
1answer
66 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 ...
0
votes
1answer
22 views

XNA 2 3D Objects Depth Convergence Error

Gah! I have a scene with 2 3D objects - a plane and a sphere; the plane sits on the xy axis with a depth if -100 and diameter of 200; the sphere diameter is 32 and sits on the xyz = 0 position; ...
4
votes
0answers
85 views

XNA Shader working different on different PC's

I am working on a game in C#/XNA which uses custom shaders for drawing. When the code is compiled on my machine it works perfectly on all computers I tested, but when my team member tries to compile ...
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)) { ...
2
votes
1answer
52 views

XNA Advanced font rendering (outline, shadows, etc) [closed]

I am looking for a tool that will output spritefonts for XNA consumption that have an outline effect. I know that this can be done by rendering the text multiple times, but I'd like to take care of it ...
0
votes
0answers
40 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 ...
2
votes
3answers
76 views

In XNA, how do I get forms to display in front of my full-screen game?

I'm trying to open a form in front of my game, which is full-screen. However, the form seems to appear only behind the game window. At the moment, I'm doing this: protected override void ...
4
votes
1answer
62 views

Optimizing my 3D XNA game

I've come to a point where optimizing my game is very much needed.My update() routine takes 0-2ms. My draw() routine takes about 100ms when drawing 3.5M triangles (Not the amount I really have to ...
1
vote
2answers
112 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
207 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 ...
4
votes
1answer
49 views

How to link the game class to the main menu class in XNA?

So I got my game in another class and my main menu in another class. This is the update method in my Main menu class MouseState mouse = Mouse.GetState(); switch (CurrentGameState) ...
0
votes
1answer
32 views

Updating score in collision detection game in XNA

I created a collision detection game in XNA but I have a problem with the scoring. As online tutorials says, I initialised it score = 0; This is in the update section to check if the person hit ...
0
votes
2answers
55 views

How to draw the elements that are in a Texture2D list in XNA

I have a Texture2D list called blockTexture that has 2 elements in it. I use the following line to draw the first element. foreach (Vector2 blockPosition in blockPositions) for (int i = 0; i < ...
2
votes
1answer
35 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
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 ...
0
votes
0answers
33 views

C# - XNA blurring tiles despite using PointClamp SamplerState

I´ve a problem drawing isometric tiles without getting pixel issues. The way I do it is the following: SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, ...
2
votes
1answer
23 views

XNA coordinates countdown

Usually XNA increasing X coordinate to right and Y to down. Like this But in my project i have 2D map. Drawing tile with bigger Y coodinate below OX looking strange (usually people imagines these ...
0
votes
0answers
29 views

How can I create a character for a 2D platformer in Farseer Physics 3.5?

I want to create a similar character like in this tutorial. http://www.madgamedev.com/post/2010/09/09/Article-XNA-Farseer-Platform-Physics-Tutorial.aspx But the tutorial doesn´t work for Farseer ...
2
votes
1answer
25 views

Can I use a BlendState object to emulate a draw call's blending color?

I'm working on a lighting system for a tile-based game. What I want to do is draw my tiles to the screen, then draw a single Texture2D object (my light map) over top of them. However, doing it in ...
0
votes
0answers
53 views

Drawing objects in view of camera only in XNA/MonoGame

I am working on a Tower defense style game on mobile that uses a tile map and I am trying to determine the best way to draw overlays of those tiles. In my game, I go into build mode to build towers. ...
0
votes
0answers
28 views

Problem with collision between two farseer bodies

I have four different bodies. Ground, rectangle, red ball, white ball. The rectangle and the ground are static. Just the balls are moving. The red ball can´t move through the rectangle, but the white ...
0
votes
1answer
59 views

How can I save an XNA texture as a PNG file?

I have a Color[,] variable and I already know how to convert it to a Texture2D. How do I then save it as .png image?
0
votes
1answer
54 views

Rotation Continuity help

First the issue im having: Basically its the fact that the angles of a circle aren't continuous, they rise from 0 to 2pi then immediately fall back to 0. I want to make a game where the player ...
1
vote
0answers
39 views

How to create offsetting lines that draw across the screen in Monogame?

I'm trying to create an effect on the screen like the gif below. Basically lines that are offset by 1 pixel draw across the screen from either side which then eventually creates a solid color. I'm ...
3
votes
3answers
133 views

How to create a delay/timer and fire an action once it expires in C# Monogame? [duplicate]

First off I'm somewhat new to C# but I'm working on a game in C# Monogame and I'm trying to get timers working. There was a similar question answered around here a while back but I found that the ...
3
votes
1answer
122 views

Effective AI for 3D Motion

I am developing a game in XNA and am trying to create an effective AI for the enemy and friendly spaceships but am having a hard time keeping the game effective without disadvantaging one side or the ...
2
votes
1answer
68 views

Replace black color by transparent color XNA

I'm actually trying to replace black color of my texture by a transparent one. How can I do to remove the black pixels, should I use a AlphaTestEffect, or can I use the BasicEffect? Thank you.
2
votes
2answers
93 views

Draw 3D ellipse in monogame/xna

I am programming a 3d solar system (simulator). To describe the path of a planet I wanted to add 3D rectangles.. and draw them. But this ; no surprise; decreased the frame rate extremly. Also it does ...
2
votes
0answers
50 views

Mouse Interaction in 3D space (ray)

I use this code public static Ray CalculateRay(Vector2 mouseLocation, Matrix view, Matrix projection, Viewport viewport) { Vector3 nearPoint = viewport.Unproject(new ...