Questions tagged [xna]
XNA is a free set of game development tools from Microsoft that facilitate game development for Xbox 360, Windows Phone, Zune and Windows platforms.
28 questions
1
vote
1
answer
84
views
Camera Movement in a World Map
using XNA and C# I built a game as a tutorial, but I have since added functionality to allow the player to move around on a world map which requires the camera to "move" but I no longer like the look ...
14
votes
3
answers
4k
views
Optimizing an A* algorithm
I am currently using an implementation of the A* algorithm described here.
Currently, when I run my algorithm, my IDE lags horribly and the .exe generated also lags terribly. Using the CPU analyzer, ...
3
votes
2
answers
155
views
2D A* Path-Finder
I have re-coded my entire path-finding class, it used to follow Dijkstra's Algorithm, while also being super inefficient, using Lists and a lot of other bad things that I had/have no idea about.
...
2
votes
1
answer
2k
views
Prepend data to stream in C#
I'm working on an XNA project that loads several resources that are packed into a single file. XNA can take a WAV file stream and turn that into a SoundEffect (seen below in "case ".wav"").
Since ...
16
votes
4
answers
596
views
Entities and the things they do
So I have an Entity, which is responsible for providing an abstract base for other objects to inherit. (Like Actor objects, ...
7
votes
3
answers
422
views
XNA KeyboardStateManager
This class allows for easy management of the KeyboardState of an XNA game.
It provides a simple, easy-to-use API for interacting with the Keyboard and getting key-...
5
votes
3
answers
181
views
RPG game using XNA
I know this code needs some organization like classes, enums, methods, arrays or something but I just want to know if I could have created a character movement script, thereby shortening the code ...
7
votes
4
answers
375
views
Memory usage in Reversi board state
I'm coding a Reversi game, with an artificial intelligence using the MinMax as the search algorithm. My concern is that (most) search algorithms needs to store a lot of instances of "states", in my ...
4
votes
1
answer
49
views
Creating a set of buffers for tiles
I am currently converting a 2D game to 3D, never having worked with 3D before I am trying to learn as I go. I am wondering what the best way to use vertex/index buffers is.
I am currently looping ...
5
votes
2
answers
189
views
Interface for a transformable grid
I am working on an XNA project, and since procedural generation is likely to be used, I wanted to eventually create a helper class to work with data to facilitate that.
Design Goal:
Originally, I ...
2
votes
1
answer
77
views
How can I better handle images that I don't need drawn anymore (for now)?
For minimalist sake, let's say I have an image of a button in a game and on the screen.
When you left-click the button, it will disappear. If you right-click (anything), the button will reappear.
I'm ...
2
votes
2
answers
176
views
Is my code overdesigned? Does it rely too heavily on interfaces? [closed]
Context:
I am using XNA to create a simple game / learning project.
Problem:
I have three interfaces, each with a different purpose in mind. However, the way I use them, as well as their ...
9
votes
2
answers
755
views
Smoke particle system
Please note that I'm working on a game on Windows Phone 8 using Monogame. The game is fine (60 FPS) all the time, except when the particle system is activated. This is just a smoke particle system ...
7
votes
2
answers
298
views
Encapsulation, fields and properties for Asteroid class
After changing all variables in this code from public to private and adding get/...
7
votes
1
answer
111
views
Turn multiple key presses into single GameAction
The InputHandler class for my game detects key presses, turns each one into a GameAction, and raises an event:
...
18
votes
2
answers
2k
views
Sprite animation handler
When a user presses a key in my game, their avatar can move down, left, right or up. By move, I mean their avatar animates while various other things move around them on the screen. This is ...
4
votes
1
answer
273
views
Improving XNA's default project template
I hope this isn't getting annoying, but I've asked a lot of questions about improving my game lately:
How can I improve my game project design?
Using the observer pattern with collision detection
Is ...
3
votes
1
answer
252
views
GameState Management efficiency
So I've read numerous tutorials on handling game states in XNA, and to each tutorial I've been read, it was different from the others. Now I want to ask which way is more efficient? I've created my ...
4
votes
3
answers
2k
views
Using the observer pattern with collision detection
My Game class has a property of type Player, which inherits from Entity:
player = new Player( "knight.png" );
It also has a property of type World, which has a ...
3
votes
1
answer
182
views
Position update loop and checking collision
I'm writing a laser connection game. This is my first game on Windows Phone, and I've never used C# and XNA before.
The part of my code that could be improved is ...
7
votes
2
answers
2k
views
Sprite animation for a game
I'm just getting started with XNA and game development in general. I followed these instructions to create a basic game, then this article to get sprite animations working.
Now, I'm trying to ...
7
votes
2
answers
8k
views
Determine if an int is within range
Can I somehow make this a bit cleaner using Math.[Something], without making a method for it?
...
4
votes
1
answer
409
views
Distance checking of normalized vectors?
I've been learning C#/XNA in an attempt to make a game for the past few weeks so maybe this is an obvious newbie thing, but here goes:
I've been making a fairly simple 2D game, so I have a list of ~...
3
votes
1
answer
175
views
I was wondering if there was a better way to improve my XNA joystick code? (Vb. Net)
I'm on a high school robotics team and I'm trying to code a Xbox 360 controller so that it'll controller the motors with variable speed. So far it works alright, but where I'm quite the novice coder I'...
1
vote
1
answer
1k
views
C#/XNA interface usage, repeating functions
Essentially I'm wondering if this implementation of an interface is correct. I mostly don't like having to repeat the exact same getters and setters. Is there a better way or is this alright?
...
2
votes
1
answer
83
views
Sorting entities by Z in every call to Draw
My implementation contains a SpriteComponent class which has a Z property; I use this to determine the order in which to draw my ...
22
votes
1
answer
1k
views
MVC in XNA game development - rudimentary MVC GameEngine
I've read a lot about using MVC in game development and it seems to be a good way (speaking of testing, code reusing, etc ...)
I created a XNA project and tried to implement MVC. But I'm not sure if ...
4
votes
3
answers
950
views
Optimizing lighting algorithm for a voxel engine
I am creating a Minecraft-like terrain engine in XNA to learn HLSL and more XNA. The problem is my lighting algorithm. Whenever a block which emits light is placed, it takes about half a second to ...