XNA Game Studio 4.0 is a programming environment that allows you to use Visual Studio to create games for Windows Phone, the Xbox 360 console, and Windows-based computers.

learn more… | top users | synonyms (1)

0
votes
2answers
292 views

Add a “fake” Loading Screen

I'm working on a 2D game for WPF8 using XNA 4.0. Everything goes great, but it's too fast. I was just wondering, what could I do between the end of the game and the score screen, and before the game ...
3
votes
1answer
520 views

How can I use orientation to compute position in Windows Phone 7? [closed]

I'm using the motion API and I'm trying to figure out a control scheme for the game I'm currently developing. What I'm trying to achive is for an orienation of the device to correlate directly to a ...
4
votes
1answer
1k views

Compiling a Monogame Game into a single .exe

Is it possible to compile a monogame game into a single .exe? I know if you go in the debug or release bin, there is in fact a .exe your game, except you move this .exe's file location or try to run ...
0
votes
1answer
118 views

Where does XNA 4.0 takes memory from to perform operations?

I found this question which talks around the question I'm interested in. In particular I focused on the line where the guys says that GraphicsDevice object is literally a representation of the ...
6
votes
1answer
155 views

How should I attenuate sound in a 2D game where you can zoom in and out?

In my 2D game, I have some ambient sounds like the noise of a waterfall or the humming of a generator. However, it is not practical to play these sound all the time at full volume as in a large level ...
9
votes
1answer
636 views

Portable buffered keyboard input for XNA / MonoGame?

As a preliminary solution, I am currently using the Nuclex framework in an C#/XNA game project for buffered keyboard input. Sadly, nuclex relies on SlimDX.Directinput.dll and therefore to my knowledge ...
8
votes
2answers
525 views

What are some ways to texture map a terrain?

I'm working with XNA on a 3D Game, and I'm trying to have a proper and nice environnement. I actually followed a tutorial to create a terrain from a heightmap. To texture it, I just apply a grass ...
0
votes
1answer
275 views

Rope Colliding with a Rectangle

I have my rope, and I have my rectangles. The rope is similar to the implementation found here: http://nehe.gamedev.net/tutorial/rope_physics/17006/ Now, I want to make the rope properly collide ...
0
votes
0answers
28 views

Skip the first RenderTarget when writing to MRT with Opaque blending

I am writing to three rendertargets and whant to know how to tell a GPU not to write to the first RT. When you write a shader you can simply output less data than you have RTs (like output a single ...
1
vote
2answers
499 views

SpriteFont Exception, no such character?

I have such spriteFont: <?xml version="1.0" encoding="utf-8"?> <!-- This file contains an xml description of a font, and will be read by the XNA Framework Content Pipeline. Follow the ...
1
vote
1answer
275 views

Get screen bounds of 3D object

I'm trying to draw a 2D plane that has minimum dimensions to contain a 3D model (a sphere). How do I calculate the minimum size and position of the rectangle to completely cover a 3D model on screen?
4
votes
2answers
123 views

XNA Transparency depending on drawing order?

I am drawing two 3D objects, both of them can fade from opaque to transparent independently, and they can intersect between them (so you cannot say when one of them is before the other one). Look at ...
2
votes
2answers
1k views

XNA 2D line-of-sight check

I'm working on a top-down shooter in XNA, and I need to implement line-of-sight checking. I've come up with a solution that seems to work, but I get the nagging feeling that it won't be efficient ...
0
votes
0answers
84 views

Avoiding lag when rendering Texture2D for first time

I have found a similar question here, but it is about playing sounds. I am using 2048 x 2048 textures for sprite sheets and every time I call spriteBatch.Draw using a sheet for the first time in game ...
2
votes
3answers
851 views

Creating Rectangle-based buttons with OnClick events

As the title implies, I want a Button class with an OnClick event handler. It should fire off connected events when it is clicked. This is as far as I've made it: public class Button { public ...
0
votes
1answer
117 views

Changing enum in a different class for screen

I'm trying to make a start menu for my game and my code uses Enum's to moniter the screen state. Now i want to change the screenstate declared in the main class, in my Background class Screen screen ...
0
votes
1answer
171 views

Obtain rectangle indicating 2D world space camera can see

I have a 2D tile based game in XNA, with a moveable camera that can scroll around and zoom. I'm trying to obtain a rectangle which indicates the area, in world space, that my camera is looking at, so ...
4
votes
4answers
434 views

The physics equation for a perpetual seesaw

I am trying to create a game that involves two or more people jumping on a seesaw and propelling each other in the air. I need help with the physics equations Assume no friction and no air ...
1
vote
1answer
270 views

Best way to load texture2d tiles in xna?

I am making a test xna game as a learning exercise and I have a small question about using 2d textures. Basically the game is a grid of different 'tiles' which are taken from a text map file. I ...
-1
votes
1answer
793 views

How do I make a health bar that drains when the player takes damage? C#/XNA

I've drawn a Health Bar before and had it drain/refill on a button press using if statements and rectangles. First I loaded the image, then I set a new rectangle to be equal to the image's height and ...
1
vote
1answer
242 views

XNA - Where should I start playing a song?

I am just wondering where is the best place to start playing the background song for a game. In the loadContent() method, Draw(), or Update() methods or when I initialize it? I am trying to make it ...
1
vote
1answer
202 views

Complex Models using bounding boxes in xna 4

I'm new to XNA, and have just started looking into collision detection. I've managed to get a bounding sphere around my first person camera object and i want to check the collision between that and ...
0
votes
1answer
252 views

XNA Arcball and moving model - the model is altered instead of the camera

I'm trying to implement an arcball type camera, I've got all controls working very nicely. I can rotate the X/Y axis with my mouse and zoom in and out with the Z/X keys. The problem is, that the ...
1
vote
1answer
488 views

Parallax scrolling with 2D camera [duplicate]

I'm developing a 2D Platform game, I have a 2D camera, some backgrounds, and everything is working good. Now I want to implement parallax scrolling to give the illusion of depth in my game, but i ...
0
votes
0answers
431 views

XNA 4.0 - stretch full screen window?

I have an issue with resolution in XNA 4.0. I'm running fullscreen. The game runs standard at 1920x1080, and can be scaled down to 1280x720. The resolutions are both 16:9 (1920/1,5 = 1280, 1080/1,5 ...
6
votes
4answers
3k views

How do you manage your game resources in XNA?

In the past I have used Content.Load<type>("filename"); all over the place. This quickly becomes a nightmare to manage and worse you start having multiple copies of the same asset loaded in ...
2
votes
1answer
304 views

Resize texture in code

I need to change texture size from for example 800x600 to 80x60. I have two ideas of how to do that, but i have problems with both approaches. 1) changre render target then draw and save resized. the ...
0
votes
1answer
211 views

render sprites with a transparent background (XNA)

For my game I want to make a map of the world. Per country I made a file with the border of the country and the rest of background is transparent. This way all my files have the same width and height. ...
-1
votes
1answer
305 views

XNA - 2D Rotation of an object to a selected direction

I'm trying to figure out the best way of rotating an object towards the directional input of the user. I'm attempting to mimic making turns on ice skates. For instance, if the player is moving right ...
1
vote
1answer
115 views

What does Rectangle.Intersect means/do?

Ok I have two rectangles one is the ball and other is the paddle. 1. if(ball.rectangle.intersects(paddle.rectangle)) y = -Math.Abs(y); and 2. ...
2
votes
1answer
486 views

How to use elapsed game time for timing

I want that my ship shoots beam after every 2 seconds. How do I make that happen? and also I want that after 50 shots I want to give 10 seconds to reload the gun. I know both of my problems can be ...
1
vote
1answer
60 views

Shared Texture2D in XNA

I am trying to define texture2d objects as shared. The reason of why I am trying to do is, I made an xna user control and my project loads unlimited (as much as the user wants) my XNA User Control. ...
2
votes
0answers
220 views

Monogame working with Krypton

I am trying to make a simple 2D game engine using Monogame and the Krypton 2.0 lighting engine. So far I have succeeded in rendering a light but I am unable to generate any shadows from any hull's. ...
0
votes
1answer
194 views

Collision Issues

When I run the collision code, there are no errors, but when I shoot the enemy nothing happens..... Any problems that are blindingly obvious? Class Level Variables public Model model { get; ...
-5
votes
2answers
816 views

Repeatedly Shooting Bullets

I'm making an XNA shooter game. How do I have my sprite repeatedly shoot bullets instead of waiting for one bullet to go off the screen. Do I do this with and array?
0
votes
1answer
177 views

First person shooter camera movement

I am making an FPS in XNA. I cannot seem to make a FPS camera that I can move Forward, Back, Side to Side using the keyboard. How do I do that?
1
vote
3answers
64 views

2D Camera doesn't work when I have split my code into DrawableComponents

I have the following camera written: public class Camera { public Vector2 Position; Viewport Viewport; public Matrix Transformation { get { return ...
2
votes
1answer
80 views

What is the best way to follow this book using XNA 4.0 instead of XNA 2.0

I found a reference to this book on the Microsofot Indie games forums: http://www.amazon.com/dp/1430209798/ref=pe_385040_30332200_pe_309540_26725410_item I'm really interested in it, because the ...
6
votes
2answers
285 views

Where to put Entity Death Events in a Component/System Design

Entities in my game are nothing more than a collection of components, tied together with an entityID. I have (near) data-only components, and systems that work on the data. One of these components is ...
0
votes
1answer
285 views

C# XNA4 2D Collision Detection

I am working on a 2D engine in Xna and am running in a bit of trouble with Collision implementation. What I want to do is have an interface ICollidable that I can add to GameObjects that are ...
1
vote
1answer
322 views

Pixel Shader - apply a mask (XNA)

I'd like to apply a simple few masks to few images. The first mask I'd like to implement is mask like: XXXOOO I mean, that on the right everything is masked (to black), and on the left everything ...
0
votes
1answer
125 views

How to control in the vertex shader where pixel ends up in the renderTarget?

What if I have an arbitrary renderTarget, that is smaller than the screen (say it is 1x1 pixel) and I want to make sure in the VertexShaderFunction that all my pixels end up exactly in that 1 pixel ...
0
votes
1answer
150 views

Using a Vertex Buffer and DrawUserIndexedPrimitives?

Let's say I have a large but static world and only a single moving object on said world. To increase performance I wish to use a vertex and index buffer for the static part of the world. I set them ...
1
vote
1answer
720 views

Loading images in XNA 4.0; “Cannot Open File” Problems

Okay, I'm writing a game in C#/XNA 4.0 and am utterly stumped at my current juncture: Sprite animation. I understand how it works and have all the code in place, but my ContentLoader won't open my ...
2
votes
3answers
159 views

Should Draw method calculate the element's screen location?

Should Update take care of calculating the drawing position of element or should it be done exlusively in Draw method? If I calculate the drawing position of element in Update and then store it as ...
1
vote
0answers
98 views

DepthStencilState System.ObjectDisposedException [closed]

I developed a Windows Phone 7 & 8 game and released it already. Having integrated BugSense, I received a handful of errors mainly from specific versions of Windows Phone 8 OS (mainly ...
2
votes
0answers
285 views

XNA 4.0 Pixel Shader 3.0 Exact Texture Lookup/Sample Issue

I am stuck on trying to solve this problem. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow ...
2
votes
2answers
348 views

How can I actually understand Instanced Geometry Rendering - so that I can implement it the way I need it

I'm stuck trying to implement instanced mesh rendering in my project. Particularly because I am failing to understand how certain components actually function - and how the drawing routine is actually ...
2
votes
1answer
216 views

XNA Framework Reach profile does not support separate alpha blend

Yesterday I released my app 'Pic Words' to the windows phone store. It is an Silverlight/XNA app that runs on Windows Phone 7.1 & 8. I have BugSense incorporated into my app. Today I started ...
3
votes
1answer
130 views

Smoothing the scrolling path in 2D

I have the following problem: In a 2D game the screen can scroll in any of the 4 directions. Basically, the center of the screen during scrolling moves from (x1,y1) to (x2, y2) whereby (x1,y1) is the ...