Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [xna-4.0]

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.

1
vote
1answer
35 views

XNA: Classes with Texture2D to be treated as one

Summarised Problem: I have an Animation class that I want to be able to treat as a Texture2D field when need be. I do not ...
0
votes
0answers
52 views

XNA 4.0 C# How to draw cube with the index method

EDIT NOTE: I was trying to impliment indexing to my code instead of instancing. I left the indexing method because in my case, I don't need to use it. Preview Untill now I have drawed my cube with ...
0
votes
1answer
41 views

XNA 4.0 How to combine triangles vertices 3D

Preview for the problem: I'm making a similar game to Minecraft (a game that it's world is made by cubes), but the fps of the game is getting low only by rendering a little amount of cubes in the ...
0
votes
1answer
26 views

XNA 4.0 How to change GraphicsDevice Default DepthStencilState Value

I want to change one of the deafult values of my GraphicsDevice to that: GraphicsDevice.DepthStencilState.DepthBufferEnable = true; But I know only to change it ...
0
votes
0answers
60 views

Why do I have to set the rendertarget to null explicitly in MonoGame?

I'm using shaders in MonoGame. I have the following code, which works fine. It fills a scene with ambient light, and applies a 2-pass gaussian smoothing to the lightmask. I have one thing that bothers ...
-3
votes
1answer
48 views

What is a Linker Map Address ()

I need to know how to execute a linker map address and use a draw method in xna 4.0 to for example in c# My subfolder has this in it textures models sounds ui scripts shaders linker map address <...
0
votes
1answer
121 views

Monogame Effect World Translation Z and alpha in objects not visible behind

I have an effect in each triangle and rectangle: In the triangle class I have: ...
0
votes
1answer
55 views

Creating “Tube Lights” and switches

I've been banging my head at this for quite some time now. I'm creating a 2D stealth game and want to implement "lights" in rooms like in DeadBolt, and I cannot think of any way how I must go about ...
0
votes
1answer
161 views

Xna Spritefont from installed fonts

I am using Spritefont in my game and I have downloaded a .ttf font and installed it on my machine. I am now using this font in my game. My question is if this game is run on another machine will the ....
0
votes
1answer
118 views

Reading a text file and changing each digit into a value inside an array c#

I'm having a bit of an ordeal with the StreamReader. I'm working on a game where you build the map with a 2D array by imputing different numbers so the array like this: ...
1
vote
1answer
44 views

When drawing text, numbers appear as D1 or NumPad1 rather than just numbers

Been writing a class for a main menu, there's a play button and when pressed it goes to a window that asks for coordinates, sadly when writing with the keys and using the numbers the output is either ...
1
vote
0answers
41 views

XNA Displaying/Drawing from a text file [closed]

I wrote this code in the Load Content of XNA 4.0 for reading the star map, after actually adding it to my content, and I have no idea how to write/draw it onto my application, any suggestions? ...
0
votes
1answer
29 views

Getting a sampler of the default rendertarget (null)

I've been working on a mod for "Duck Game" that adds dark levels like in Spelunky. I read this guide on how to make shaders, but in my case I don't have access to the draw method and since the game ...
1
vote
0answers
42 views

XNA Further faces are shown through closer faces

I'm trying to draw a 'axis' model named 'XYZ'. The problem is that it is rendered wrong (screenshot below). You can see that the blue face can be seen through the red face. The black, green and red ...
1
vote
0answers
24 views

XNA game for Xbox360

I learn XNA 4 and made a simple game for Windows. Now i want to run it on Xbox360. I choose "Create Copy of Project for Xbox360" and build it. After that i have in bin folder two files with extensions ...
0
votes
1answer
74 views

Vector for bullet direction XNA C#

im creating a platform shooter. the gun can be rotated using the thumbsticks. i want to use a line of fire newBullet.bulletVel variable as a Vector 2. this variable ...
0
votes
1answer
127 views

understanding image rotation XNA C#

I do not understand how the rotation of the image i have works. Is it something to do with the ThumbSticks on the Xbox Pad? or properties of a float? if someone could explain to me what is actually ...
0
votes
1answer
157 views

TileMap collision detection

I'm currently working on a project in XNA and I'm trying to implement collision detection but can't wrap my head around how exactly i'm going to do it. I'm using the Tiled application to create my ...
0
votes
1answer
32 views

Crouching Up and Down XNA C# Controller

The game is a 2D platformer. The problem I have is when I press the B button to crouch from standing, I do not know how to implement a function where B can be pressed again to move back to the ...
0
votes
1answer
1k views

2D collision detection for a block game

Background Knowledge: The player can be freely transformed around the screen but each block is locked to a grid. This grid is 16x16 pixels and the players bounding box is 20x44 pixels. The blocks are ...
1
vote
0answers
79 views

Pixel-perfect collision appear to have random behaviour

So I was sitting with my programming teacher with this issue for about two hours and we couldn't figure out anything specific that could possibly be the issue. Therefore I'm taking some measures and I'...
1
vote
1answer
205 views

Why do I get this error when converting an XNA .fx to a MonoGame .fx?

I am learning game development in Monogame via book for XNA 4.0. In the code below which is for drawing the terrain, I get the error in the comment. Im using an effect from Monogame content pipeline ...
1
vote
1answer
92 views

Using a Windows forms Textbox control in an XNA game

What I want to do is this: Use a standard Textbox control in an XNA game. This will be the only control used, and the game is designed in xna alone. I (for some reason) cannot get the game to "see" ...
3
votes
1answer
506 views

XNA / MonoGame - render transparent background using stencil buffer problem (3d)

I'm trying to render 3d texture quads with the following properties: With lighting (rule out "AlphaTestEffect"). Transparent background (no opacity levels, just binary opaque or transparent). No ...
3
votes
2answers
68 views

How to force XNA to render model very far away as a light dot?

Making a space strategy game focusing on commanding a large fleet, with 1000+ ships per side.(I'm new in XNA 3D...below is a test screenshot. The ships will be scaled down another 2-5 times) When a ...
1
vote
2answers
154 views

How Should I Go About Updating My XNA Game?

So, I've created an XNA game, but I'm not selling it... it's just a private game to give away to my friends, more of a practice project. But say I find a bug, or think of a new feature... I don't ...
1
vote
0answers
103 views

XNA 4.0 Camera and object handling on screen

For developing a side-scrolling platform 2D game I want to implement a moving camera class, the reason of using the class instead of moving the whole map is that I'll have to use too many objects at ...
1
vote
1answer
297 views

Any good pattern for managing user input in XNA

I'm doing some experimentation on XNA, and unlike past experiences with XNA, I wanna do stuff right. Are there any good patterns for managing user input? Like... how do I manage what components get ...
1
vote
0answers
119 views

XNA Deserialization Error: XML element “Type” not found

I want to deserialize an xml file that contains a path for an image I have 3 projects: One with the Program.cs class and the main template stuff from xna, another with classes such as the default '...
0
votes
2answers
189 views

MonoGame Gamepad Y axis flipped?

I'm following a book I bought on Google Play that is teaching me the ropes of MonoGame, and in Chapter 2 it introduces creating an input wrapper that takes care of all the input methods for a game pad ...
1
vote
1answer
97 views

How can i show all edges in monogame?

I am using Monogame 3.5 and i have simple model of cube. I use BasicEffect to draw it. I want it transparent so i use ...
2
votes
1answer
510 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 ...
0
votes
1answer
224 views

Exception whilst 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
votes
1answer
68 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. ...
1
vote
1answer
512 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 one ...
0
votes
1answer
117 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
3answers
3k views

How to restart the game when pressed enter in XNA

If the following code allows the game to exit when pressed esc .. ...
3
votes
1answer
293 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 ...
0
votes
1answer
339 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 ...
0
votes
2answers
746 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. ...
2
votes
1answer
193 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 ...
0
votes
1answer
174 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 ...
7
votes
2answers
256 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 ...
2
votes
4answers
195 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
138 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 ...
1
vote
1answer
74 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 ...
2
votes
1answer
908 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 ...
0
votes
2answers
536 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
1answer
2k 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 ...
1
vote
1answer
609 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, ...