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
1answer
102 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 ...
-1
votes
1answer
415 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
169 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 ...
0
votes
2answers
139 views

Collide with rotation of the object

I'm developing a mirror for lazer beam(Ball sprite). There I'm trying to redirect the laze beam according to the ration degree of the mirror(Rectangle). How can I collide the ball to the correct angle ...
0
votes
0answers
41 views

I am getting zero in my int x() when using Mouse.getstate().X?

Ok I have a Function int x(), which is used in new Rectangle(x(),a,a,a); in DrawMethod in XNA but when I use it I get x() = 0 as as the answer.Here is my CODE: int x() { int px ...
1
vote
1answer
354 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
1answer
222 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 ...
0
votes
0answers
272 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 ...
2
votes
1answer
203 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
174 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. ...
0
votes
0answers
49 views

What's the function to Stretch a sprite?

My goal is to find the function to stretch a sprite like my example below, and then get it to animate during a certain time. It is like an interpolation, where the starting point is the original ...
1
vote
1answer
108 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
243 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
55 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. ...
0
votes
1answer
132 views

Texture2D can't find my sprite - how to setup the content directory in XNA

So I keep getting told that spr_lives can't be found. I'm working out of a book and using the samples given to me (have not changed the code or folder structure, so it /should/ work) but nothing's ...
2
votes
0answers
175 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
117 views

Mouse input not updating in custom XNA/Winforms panel

I have a custom Panel residing within my WinForm. the custom Panel holds the XNA rendering. So far, I've rendered an 3D test model. What I'm doing now is trying to handle the input.Using a camera from ...
0
votes
1answer
188 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; ...
0
votes
1answer
156 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?
2
votes
1answer
74 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 ...
0
votes
1answer
237 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 ...
5
votes
2answers
261 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
128 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 ...
0
votes
1answer
118 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 ...
2
votes
3answers
151 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
82 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 ...
3
votes
0answers
127 views

How do I generate a mipmap for a texture loaded from a stream?

I am loading a Texture2d from a stream: public static Texture2D GetTexture(GraphicsDevice dev, System.Drawing.Bitmap bmp) { Texture2D texture; using (MemoryStream s = new MemoryStream()) ...
2
votes
0answers
252 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
1answer
174 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 ...
2
votes
3answers
328 views

XNA 3.1 to 4.0 Vertex Shader Not Drawing

I have recently been converting our XNA 3.1 game to XNA 4.0 and am stuck on the shaders. I have the game running, but nothing is drawing to the screen, except things not using a shader. This is only ...
1
vote
1answer
230 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 ...
3
votes
1answer
123 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 ...
1
vote
3answers
59 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 ...
1
vote
1answer
230 views

World to Pixel Transformation

My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what ...
2
votes
2answers
270 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 ...
4
votes
2answers
226 views

Refractive blur in XNA?

I'm writing a 2D hack-and-slash game using XNA. I really want to implement the blur-like, refractive effect of a sword or such moving really quickly, seen in such games as Dust: An Elysian Tail and ...
7
votes
3answers
526 views

How do I target a tank turret with an offset barrel?

I have a tank model consisting of multiple parts, a body, a turret and the barrel of the gun. The turret is offset from the body origin and can rotate around the Y axis(up). The barrel is connected to ...
10
votes
1answer
370 views

How to know if the player is signed in?

I was wondering if there's any way to know if the "player" is signed in or not? Something like this: if (GamePad.GetState(PlayerIndex.Two).IsConnected && !Gamer.PlayerTwo.IsSignedIn) So ...
0
votes
1answer
104 views

Resizing a parallax background (bug)

I'm attempting my first 2D vertical scroller and can't seem to get the background size to work. For some reason, it stays small. I think in the beginning of the parallax scrolling class, I was told to ...
2
votes
1answer
203 views

XNA matrix order problem

I want a matrix that scales first and then rotates. I tried the code below, but it didn't work. zRotation, yRotation and xRotation are rotations that shouldn't be affected by the origin. allrot should ...
0
votes
0answers
46 views

Certain grid lines not rendering as expected

I am drawing a simple quad (a triangle strip with 4 vertices) as the floor and then drawing an 8x8 grid over top (a collection of vertex pairs for a line list). The vertical grid lines work fine ...
0
votes
1answer
48 views

stretch images when window is re-sized in XNA

Is there a way to re-size all the images inside the view port in a XNA project. At the moment when I re-size the view port the background stays at the same size of the image when I want it to re-size, ...
1
vote
1answer
560 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 ...
0
votes
1answer
339 views

Windows Phone XAML and XNA Apps with Game Components

I am using the Windows Phone Template "Windows Phone XAML and XNA Apps" and targeting Windows Phone 7/8. Most examples show your game inheriting from Microsoft.Xna.Framework.Game and then adding ...
3
votes
0answers
131 views

ways to program glitch style effects [closed]

Most tutorials for generating glitch art usually has to do with some form of manipulation of the compression of files. Should my goal instead to replicate the look of these glitches in shaders or is ...
1
vote
1answer
334 views

Unable to create suitable graphics device?

I've been following the Eye of the Dragon tutorial, which is basicly a guide to making a 2D RPG game, obviously. I recently finished the tutorial about making pop up screens in the menu and changed ...
-11
votes
1answer
190 views

extremely frustrating yet noob question [closed]

This is incredibly embarrassing but.. I musta hit a key or something but whenever i go to edit a line of code i have, i can't just add extra code in.. it always writes over the top of my code and ...
1
vote
1answer
92 views

How to grab textures from a texture atlas to be applied to 3d objects

Fairly basic question, but I'm having trouble on finding information on this sort of thing for beginners. I'm just trying to make cubes with different textures on the sides as a starting point. I have ...
1
vote
1answer
1k views

What is the status of Monogame now that XNA has been discontinued?

XNA has officially been discontinued, with support no longer being offered by Microsoft. Does this mean that Monogame has died also? I see that the site still says it is based upon XNA 4. What is the ...
0
votes
1answer
147 views

Issues with touch buttons in XNA (Release state to be precise)

I am trying to make touch buttons in WP8 with all the states (Pressed, Released, Moved), but the TouchLocationState.Released is not working. Here's my code: Class variables: bool touching = false; ...