Questions tagged [xna-4.0]

Version 4.0 (Final) of Microsoft's XNA Framework. If you use this tag, please also include the main tag XNA.

is the final version of Microsoft's XNA Framework.

XNA is a cross-platform framework originally from Microsoft that facilitates game development with .NET. Supports: Windows, Xbox 360, Windows Phone (natively), Silverlight (via SilverSprite or ExEn), iPhone/iPad, Android, Mac OS X, Linux and other (via MonoGame).

This was the definitive version that came out at 2010-09-16. Despite that it's no longer developed, It's still used for plenty of projects as of 2017.

If you use this tag, please also include the main tag .

1200 questions
-1
votes
1 answer

XNA Slope Math formula

I'm trying to implement slopes in a 2D game by using this formula y1 = y + (x1 - x) * (v/u) for slopes with random degrees. I need a formula for the other direction (from right to left downwards). This formula y1 = y + (v - (x1 - x)) does not work.…
Xhen
  • 1
  • 2
-1
votes
1 answer

Mouse changes object

I am working on a game (c# and xna game studio 4.0) which is familiar to Mario. I want to make object change color when the mouse us on the object. Will something like If(Mouse.Intersects.(object)) {} work
-1
votes
1 answer

How do you use Form.ShowDialog(); correctly with program.cs?

I am trying to make a winform open an Xna form. looking online the best way I discovered was to open the form first through program.cs, and then put an if statement that checks if you hit the start button on the winform that will give…
Alexandre
  • 148
  • 7
-1
votes
1 answer

How to compile a string xna

Basicly, I want to create code that I can compile from a STRING that I will be loading from a file. Is that even possible? I did my research and I couldn't find any answers.
Monset
  • 648
  • 5
  • 25
-1
votes
1 answer

C# XNA Collision detection with random falling sprite

i am new in XNA .i am trying to build a small 2D game where enemy(ball) are falling from the top of the screen randomly.the player can move inside the screen. what i want to do is when the player(spaceShip) collide with the ball the ball will remove…
EA Rashel
  • 167
  • 2
  • 9
-1
votes
4 answers

Why i'm getting exception InvalidCastException?

The message: Unable to cast object of type 'Microsoft.Xna.Framework.Graphics.Effect' to type 'Microsoft.Xna.Framework.Graphics.BasicEffect' The code: foreach (ModelMesh mesh in xwingModel.Meshes) { // This is where the…
Shiran Yeyni
  • 35
  • 2
  • 9
-1
votes
1 answer

Functions like Focus() and properties like Focusable not available for silverlight, only .NET?

Short version: Solutions like the following: How Do I Give a Textbox Focus in Silverlight? Don't seem to work because functions like Focus and properties like Focusable DON'T EXIST for silverlight and only exist for .net apparently. Background/Long…
-1
votes
1 answer

Error creating a hitbox?

So I have a HealthPickup class and a Player class. Each class has this line of code: public static Rectangle Hitbox = new Rectangle(Pos.X, Pos.Y, Tex.Width, Tex.Height); My question is, why is there an error on the Player class and not the…
Pyroglyph
  • 164
  • 5
  • 14
-1
votes
1 answer

KeyboardState in XNA c#

Hello I have some trouble in XNA, here my code I make a array with a length of 4 //Initialize Keyboard oldState = Keyboard.GetState(); int index = 0; //Update KeyboardState currentState = Keyboard.GetState(); if (index != 0 &&…
user3187675
  • 139
  • 1
  • 10
-1
votes
1 answer

How to get number of objects registered in XNA ContentManager?

Is there any way to obtain the number of objects registered in the XNA ContentManager ?
ares_games
  • 1,019
  • 2
  • 15
  • 32
-1
votes
2 answers

Drawing multiple sprites in XNA with an increment in position

So I'm new to XNA and am attempting to draw multiple sprites to the screen in the easiest way. I want each sprite to be incremented in the X axis so that I am left with multiple sprites drawn across the screen. I have defined: Vector2 pos; In…
Rich
  • 15
  • 1
  • 9
-1
votes
1 answer

Beginning Game Programming. Reference not resolved in Visual Studio 2012 (Lab 10)

I'm using Visual Studio 2012 Express for Windows Phone to follow this XNA course. The course is intended for XNA in Visual Studio 2010, but the professor said most people wouldn't have any problem in running other IDE configurations. The project…
-1
votes
1 answer

How to implement an XNA-Game into a Windows-Form

I want to add a updatable and drawable Control into a windows Form, wherein I can let my game being played, but also is possible to go go fullscreen, if needed. How can I do this?
LostPhysx
  • 3,573
  • 8
  • 43
  • 73
-1
votes
1 answer

XNA 4.0 3D Collision

I've been trying to work on a 3d forward-runner game (like temple run) in XNA 4.0. I'm hitting a bit of a brick wall, so any help would be much appreciated! Currently, I'm using my own method for collision detection, which requires the dimensions…
Jack
  • 472
  • 6
  • 13
-1
votes
1 answer

Moving a camera in XNA, C#

I am trying to make a scrolling level to a test game I am doing as a learning exercise. I have created a map containing lots of tiles which are drawn according to their position in an array. I basically want the camera to scroll down the level, but…
Pectus Excavatum
  • 3,593
  • 16
  • 47
  • 68