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
-2
votes
1 answer

Error with constructor when inheriting using a base class

Hey im new to c# and XNA. My goal is to inherit from a Sprite class and make classes such as pongSprite, paddleSprite etc... Im getting an error on my constructor. I have extended the sprite class and i have put the variables and objects from the…
-2
votes
4 answers

Problems with using System.Collections.Generic; or something else

public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; …
-2
votes
1 answer

c# xna 4.0 spritebatch error

using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using…
gokul
  • 305
  • 3
  • 10
-2
votes
2 answers

How do I fix this System.StackOverFlow exception in my Pong code?

I am trying to make Pong in XNA/C# using a class for the Paddle and Ball Game1.cs: using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using…
-3
votes
1 answer

Use Dictionaries for HP to my Enemies

I´m building a tower defense game.I need to get "enemies" with 2 Health. I've been trying: foreach (float enemyKey in enemyKeysAAB) { if (bullets[key].Intersects(enemyHitboxAAB[enemyKey])) { if (hpLEnemyAAB.Contains(enemyKey)) …
Malmerdev
  • 1
  • 1
-3
votes
1 answer

Updating each Item in a list

So, I've created a list with 2 objects in. I want to make sure they both update. public static void Update(GameTime gameTime) { Player.Update(gameTime); Seagull.Update(gameTime); foreach (Seagull seagull in seagulls) { …
Adam
  • 1
  • 1
-3
votes
1 answer

Hand tracking with Intel Perceptual Computing SDK and XNA

I am creating a game in C#/XNA. I am using the Intel Perceptual Computing SDK for hand gestures and movements. I am having a hard time figuring out how I am meant to get a dot to follow my hand. Any help would be grateful. Thanks!
-3
votes
2 answers

Creating a 3D cube model with XNA code

I started to program a 3D game using XNA, and I want to make a function that will create a 3D cube by height, width and depth properties. I couldn't find anything like that on Google, and that's why I'm asking here. I want the function to return a…
user2466186
  • 11
  • 1
  • 2
-3
votes
3 answers

vs2012 and xna4 (monogame)

I got totally sick from this "how to install xna for visual studio 2012" thing. I was searching a lot, checked out lot of tutorials, that work half as I want, and I really know that google is my friend. I noticed that peeps use monogame nowadays,…
Zéiksz
  • 688
  • 1
  • 11
  • 25
-3
votes
2 answers

Why this error is shown as "member names cannot be the same as enclosing type"?

Why this error is shown as "member names cannot be the same as enclosing type". Why SpriteAnimationManager is shown as error in this code? //ComplexSpriteSheetAnimationGame.cs public ComplexSpriteSheetAnimationGame() { …
madhu kumar
  • 786
  • 1
  • 12
  • 46
-3
votes
1 answer

Enemy following player in XNA and stop within 20 pixels

I'm trying to get my enemies to follow the player and stop within 20 pixels, I have tried a number of algorithms including the Vector2.Lerp(); method to try and fix this but it keeps breaking the build. Any help would be greatly appreciated. The…
Bradley
  • 617
  • 2
  • 11
  • 26
-4
votes
1 answer

trying to alter a variable from another class, not working

I'm making a game and I've run into a bit of a snag. From prior research I found a way of altering a variable from multiple classes, but it isn't working. I have set all my screens into an array list and i'm trying to use this variable to change…
MlkShakes
  • 1
  • 3
-4
votes
1 answer

C# Getting System.NullRefrenceException from Loading map from 2array

When i try to start i got System.NullRefrenceException no idéa why my code is: Tile.cs: class Tile : Sprite { public bool IsBlocked { get; set; } public Tile(Texture2D texture, Vector2 position, SpriteBatch batch, bool isBlocked) :…
-5
votes
2 answers

How to format integers?

I want the integer to move left as you add places instead of right. input = 1 output = "1 " input = 10 output = "10 " input = 100 output = "100 " input = 1234 output = "1234 " Not like this: input = 1234 output = " 1234" input = 123456 output…
Mike June Bug Captain
  • 1,013
  • 1
  • 7
  • 15
-10
votes
2 answers

Expression.IfThenElse error (C#)

I have such error: Error 1 'System.Linq.Expressions.Expression' does not contain a definition for 'IfThenElse' How to ommit it? Here's code (The AluminiumLua library for C#): public virtual void IfThenElse() { var Else =…
1 2 3
79
80