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
0answers
12 views

Check collision between List of bullets and List of characters XNA [on hold]

I have a problem with collision between List of bullets and List of characters. My hero class that run on all bullets in List of bullets. foreach (Bullet bullet in S.bullets) { ...
1
vote
3answers
235 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 ...
0
votes
1answer
46 views

XNA doing a full screen negative colors effect

I'm trying to solve a bug I have in my XNA game. I have an Effect that I want to apply on the screen when I activate an Item. Currently, I have this weird bug where it throws an exception in the ...
1
vote
1answer
352 views

Scaling Skeletal values to be able to reach objects on the screen

I have created a game using Kinect + XNA and the game runs on full screen mode.. However when i try to touch or reach a certain area on the screen using hand.. I cant reach it.. I will already be ...
1
vote
1answer
99 views

XNA arcball camera steering issue

I have an arcball set up to follow my model in XNA. It rotates around the target correctly when holding in the left mouse button and moving the mouse. It zooms in and our correctly with the mouse ...
5
votes
1answer
826 views

Stencil mask with AlphaTestEffect

I am trying to pull off the following effect in XNA 4.0: The purple area has 50% opacity. I have gotten pretty close with the following code: public static DepthStencilState AlwaysStencilState = ...
2
votes
1answer
45 views

Having trouble creating multiple sprites from one class

So I am trying to make more than one sprite using a single class but I cannot seem to get the sprites to be drawn at all or drawn in different places (they are all just on top of one another). In my ...
-1
votes
1answer
59 views

Game State being skipped

One of my game states is being skipped (pressing space goes straight to the 'GameScreen' game state skipping the 'CharSelect' state). All help is appreciated. if (currentGameState == ...
7
votes
2answers
134 views

Adjust Aim Angle for Motion with Accelerating Bullet

So, here's my problem: I have a turret attached to a ship that moves at a variable speed through my game world, shooting at the centre of another ship travelling through the game world in a possibly ...
1
vote
1answer
78 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 ...
2
votes
4answers
111 views

Wall-Sliding, Stuck at Corners

I am having trouble with my 2-D wall-sliding. Namely, when the player avatar collides with the wall, it "snaps" to the corner (see screenshot, below) and sticks there. The red, transparent rectangle ...
0
votes
2answers
107 views

Issue implementing proper collision in XNA Game Studio 4.0

I am building a game in XNA 4.0, where a player moves about a 2 dimensional (vertical perspective) map consisting of blocks. My issue is creating proper collision between the payer and the blocks ...
2
votes
1answer
60 views

Creating or saving model (.fbx or .stl) file in XNA

I have drawn a 3-D Sphere in XNA with the help of vertices (without fbx file). Now I want create a .fbx file or .stl file of this 3D sphere from XNA, is there any way to do this? or how can I save ...
1
vote
1answer
55 views

add random walls with an array in 3D xna 4

I'm trying to add walls to my 3D game. I created a wall entity and added model array public Walls() { modelArray = new Model[10]; } public void Initialize(ContentManager contentManager) { for ...
0
votes
1answer
37 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 ...
5
votes
0answers
478 views

How can I compensate for camera rotation changing PCSS penumbras?

I am implementing PCSS and I am using a directional light. The directional light volume is clamped to the camera frustum (as is typical with directional lights). So when the camera rotates, the ...
1
vote
2answers
728 views

XNA How to detect collision between 2d sprites and 3d primitives (not models)

My current status I have already read some tutorials about 3d collision. I know how ray trace works and how to convert mouse follow a vector to track the closest object that collides with out vector ...
3
votes
1answer
62 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
48 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
71 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 < ...
0
votes
1answer
65 views

XNA Platformer - Where should tile collision handling be?

I've started using XNA and am working on a simple 2D platformer (single level). However, I am stuck as to where the collision detection should be handled. Here is my current project structure: The ...
0
votes
2answers
90 views

WP 8.1 XNA custom game loop (render when dirty?)

I need to know whether it's possible to create a XNA game for Windows Phone 8.1 (which I've already) using monogame with a custom game loop. OpenGL ES has this possibility (GL_RENDERMODE_WHENDIRTY or ...
7
votes
1answer
275 views

XNA 4 game for both profiles

I am writing game in XNA 4 and this version have two profiles hi-def and reach. My problem is that I need to have my game code for each of these profiles and is very uncomfortable to have two projects ...
0
votes
1answer
204 views

XNA 4.0 - Using premade .xnb font files

Basically, for our college project, we need to use a font in xna. The only problem is that we are not allowed to install it due to admin rights. Is it possible to use and load the .xnb file that gets ...
0
votes
1answer
281 views

XNA game structure question

I see to be running into a problem here. I know it's easier to show code samples so here you go. This is my main game class namespace WindowsGame4 { public enum MoveDirection { Left, Right, Up, ...
0
votes
2answers
132 views

XNA - Efficient way to get pixel color from rendertarget2D

I'm stuck with a framerate perf down with getData from a rendertarget, what's your idea, what are the other options I can use ? I explain my problem : I'm making a board game, the objects or monsters ...
1
vote
2answers
271 views

Lightning bolt effect with particles is not continuous

I am Drawing a lightning effect animation using this image: Below the result: As you can see the outcome is not a continuous purple color as I wanted it to be, but it has black spaces in ...
1
vote
1answer
71 views

SoundEffect.Play and SoundEffectInstance.Play do not work

I am having issues playing a music file in MonoGame. The problem is, an old version worked fine, but I lost it to corruption. Basically, I create an instance, call instance.Play, and hear nothing. I ...
3
votes
3answers
3k views

Alpha blending not rendering properly XNA 4.0

I'm trying to render a tree made out of 2 rectangles intersecting in the center at a 90degree angle. The texture has an alpha channel but which ever rectangle gets rendered second causes a weird ...
0
votes
1answer
182 views

Why spritebatch.Draw shows blank output? [closed]

In my code below, I think it's correctly done. But idk, the image called by _bg is does not shown up. The screen only show White. Weirdly, there is 0 error message when I run it. (The RenderTarget2D ...
2
votes
3answers
320 views

Scaling 3D furniture while keeping the thickness constant

I am creating a program in WindowsForms and Xna that allows users to create a 3D room. By dragging and customizing different .fbx models, they can "build" a room or whatever and then look at it in 3D. ...
2
votes
1answer
752 views

Creating a Static function inside my class to handle small housekeeping tasks

I have used Unity 3D for quite some time, and a lot of my game programming experience originates from using UnityEngine. Writing in XNA, I am setting up a nested list of objects. Each object will be ...
4
votes
2answers
175 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 ...
4
votes
1answer
833 views

How can I achieve a zoom-like camera effect?

I have a top down 3D camera: view = Matrix.CreateLookAt(new Vector3(0,0,20), Vector3.Zero, Vector3.Up); Now I want to achieve the effect like when I zoom in the scene and only show a section at the ...
4
votes
1answer
232 views

Creating rectangles from the inner part of a texture2D

This may be hard to understand, but I'll do my best. You will see that the first image is a normal Mario, and the other is the result I am looking for. I'm trying to find a way to extract ...
1
vote
1answer
325 views

Can I export a model and texture from a terrain file built in Unity3D?

I am mostly familiar with building my level maps within unity, and have become quite use to its inbuilt terrain creator, in both generating my terrain, and spraying a texture on to it. I am making a ...
0
votes
2answers
441 views

Water Physics In top down 2D game

I have been making a game like Minecraft or Terraria in which you add blocks and such to the world, and I came across this interesting debacle, the game is in a top down 2D perspective, and I would ...
5
votes
2answers
762 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()) ...
0
votes
0answers
62 views

Bounding Box for 3dModel

I've tried using the code from this post How do i create bounding boxes with XNA 4.0? to create a bounding box for a 3d model, but my bounding box is way smaller than my model. My model isn't scaled ...
1
vote
1answer
219 views

How to get rid of jerky movement in scrolling? C# / XNA

I'm having a bit of trouble with my code meant to create a scrolling background of random-ish ones and zeros. When moving to the right (or left), it scrolls smoothly for a few seconds, stops/jerks, ...
0
votes
1answer
247 views

Having trouble getting shader to work with sprite batch in XNA #4

I found a neat "CRT screen" effect shader on the web, but I've never used shaders before and I can't seem to get it working properly. If I do the second sprite batch in my code here normally without ...
3
votes
1answer
94 views

Monogame - Not enough storage is available to complete this operation, on backgrounds

I am making a level selector, which works like a web slider. I am showing 12 levels per page, and I have a total number of 60, which means 5 pages of 12 levels. Each level has his on background ...
8
votes
3answers
8k views

How do I make objects move along a path?

I'm trying to get something like the below image. As you can see, there's a highway and inside of it, there'll be some objects moving (millisecond). I guess the street behavior is like a pipeline. ...
0
votes
0answers
53 views

Creating terrain in sections in XNA

I am learning XNA, and have followed riemers tutorial on multitexturing terrains: http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Multitexturing.php Which worked perfectly, however when I use ...
2
votes
0answers
125 views

Cloth effect to boned model for XNA

I'm currently working in virtual dressing project using kinect. I'm using a dress model with bone created in blender and added that to xna, placed on the customer and controlled the product movements ...
1
vote
1answer
23 views

XNA - Offscreen Vertices Optimization

Okay, I have a set of vertices that is around 10,000,000 (it's a long story, but it seems that it is needed), however only a few thousand of those will be onscreen at a time. It's currently setup as ...
0
votes
0answers
9 views

Xna remove DiffuseColor

I'm drawing my model multiple times with the follwing method. I need tiles to be yellow if they are selected. private void DrawTile(int x, int y, int z, bool selected) { foreach ...
1
vote
3answers
397 views

2D HLSL World position

I'm trying to get world position from my vertex shader to my pixel shader so that I can disable the shader once a preset X coordinate has been passed (no shading once I'm over X). Getting the screen ...
1
vote
0answers
35 views

Partially colorizing a sprite in XNA

I'm looking for a clean way of making sprites that look like the following glowing circle, except in any arbitrary colour. Originally we thought we could start with a gray-scale version of the ...
0
votes
0answers
117 views

Question about installation of FNA

I am following this tutorial to install FNA: http://gamasutra.com/blogs/MichaelHicks/20140623/219612/Converting_an_XNA4_Game_to_FNA.php In the tutorial it says too: "Make sure SDL2#, TheoraPlay# ...