0
votes
1answer
61 views

Detecting Hitbox Collisions (Rectangle)

So I have some Hitboxes set up on 2 classes, HealthPickup and Player. public static Rectangle Hitbox; public override void Initialize() { Hitbox = new Rectangle(Pos.X, Pos.Y, 32, 32); } That's ...
0
votes
2answers
164 views

How can I make an object's hitbox rotate with its texture?

In XNA, when you have a rectangular sprite that doesnt rotate, it's easy to get its four corners to make a hitbox. However, when you do a rotation, the points get moved and I assume there is some kind ...
2
votes
2answers
124 views

XNA: Non-overlapping shadows

I want to create an effect similar to the following in XNA / MonoGame: There's a background and a semi-transparent shadow consisting of several objects (two circles in this example). However, the ...
1
vote
2answers
167 views

XNA blurring moving images

Why does XNA blurs the images which moves less than 1px in between two draws? It is quite annoying, because everything looks really blurry. Is there a way to disable it? I have tried to set the ...
0
votes
0answers
80 views

Collision - Per Pixel and Rectangle Based, Combined

UPDATE:i found the error in my calculation the problem was that i needed to consider if the image is rendered flip or not to fix it just need to rub from the opposite side of the sprite I am currently ...
6
votes
1answer
155 views

How should I attenuate sound in a 2D game where you can zoom in and out?

In my 2D game, I have some ambient sounds like the noise of a waterfall or the humming of a generator. However, it is not practical to play these sound all the time at full volume as in a large level ...
0
votes
1answer
275 views

Rope Colliding with a Rectangle

I have my rope, and I have my rectangles. The rope is similar to the implementation found here: http://nehe.gamedev.net/tutorial/rope_physics/17006/ Now, I want to make the rope properly collide ...
0
votes
1answer
171 views

Obtain rectangle indicating 2D world space camera can see

I have a 2D tile based game in XNA, with a moveable camera that can scroll around and zoom. I'm trying to obtain a rectangle which indicates the area, in world space, that my camera is looking at, so ...
0
votes
1answer
285 views

C# XNA4 2D Collision Detection

I am working on a 2D engine in Xna and am running in a bit of trouble with Collision implementation. What I want to do is have an interface ICollidable that I can add to GameObjects that are ...
3
votes
1answer
130 views

Smoothing the scrolling path in 2D

I have the following problem: In a 2D game the screen can scroll in any of the 4 directions. Basically, the center of the screen during scrolling moves from (x1,y1) to (x2, y2) whereby (x1,y1) is the ...
1
vote
1answer
237 views

World to Pixel Transformation

My objects have a location in world coordinates (basically 1.0f is a meter). If I simply draw my objects using their world coordinates, each meter will correspond to a pixel. Obviously that's not what ...
4
votes
2answers
154 views

What's involved in resetting the graphics device?

I'm playing with XNA 4.0, VS2010. I've created a window (not maximized) and drawn some sprites. All is good until I resize the window, after which the sprites stop displaying or only partially ...
2
votes
1answer
236 views

Issues upscaling pixel art with SampleState.PointClamp

I'm developing a 2D game, and I'm striving to create a nice blocky low-res appearance for the game, yet allow it to be played at variable resolutions. So, I've researched resolution independency and ...
7
votes
1answer
723 views

Implementing water effects (splashes) into XNA 4.0 game [closed]

I am creating a 2D XNA game and came across a tutorial on adding water effects (splashes) to an XNA game but after implementing it into my game I can't get it to scale down. Currently it takes up the ...
0
votes
1answer
293 views

Incorrect colour blending when using a pixel shader with XNA

I'm using XNA 4.0 to create a 2D game and while implementing a layer tinting pixel shader I noticed that when the texture's alpha value is anything between 1 or 0 the end result is different than ...
0
votes
2answers
287 views

Making The Player Stop Bouncing And Stop Sinking In The Ground In A Platformer XNA

Heres a problem i've been having. I have a platformer, and whenever my player hits the ground he keeps bounding. Here's the falling code iceBoy.moveY++; iceBoy.position.Y += moveY; Now heres the ...
2
votes
2answers
148 views

Create a variety a sprites from a single image in XNA?

I want to be able to take a single image and cut them up into a lot of images to make the sprites. How would I do that in XNA since I only know how to load the texture then use it without changing it? ...
-2
votes
2answers
128 views

Drawing background is very costly/slow [closed]

I'm creating a "simple" Tetris style game for a beginner project. My problem is when I added the background (tiled look consisting of a bunch of squares), the game got very slow. It has to have ...
2
votes
2answers
709 views

Background blur in 2D game?

In an XNA 2D game, I am thinking about blurring the background slightly to increase the feeling of depth? I am already using parallax scrolling which works pretty well in terms of enhancing depth ...
0
votes
1answer
138 views

Separating Axis Theorem fails at certain angles

I'm currently attempting to add an overlap tester for an axis aligned and orientated bounding box but the solution only seems to work accurately when the OBB's angle is between -10 and +10. As the ...
5
votes
1answer
375 views

Performance of pixel shaders vs. SpriteBatch: XNA

Precondition: I read this question/answer about using shaders, or spritebatch, to render and mark a sprite. I need to do something like that. I also have a 2D lighting PoC which I need to write. The ...
1
vote
1answer
177 views

this.BoundingBox.Intersects(Wall[0].BoundingBox) not working properly

I seem to be having this problem a lot, I'm still learning XNA / C# and well, trying to make a classic paddle and ball game. The problem I run into (and after debugging have no answer) is that ...
5
votes
3answers
586 views

'Spring' physics

I'm trying to put together a struct or a method of some sort that will allow me to check the relative position between two objects, and if they're too far apart, apply a force that will draw them ...
3
votes
3answers
782 views

Moving a body in a specific direction using XNA with Farseer Physics

I have a custom polygon attached to a body, which looks like this: What I am trying to accomplish is getting the body to move according to wherever the tip of the body is. So far this is what I've ...
4
votes
1answer
345 views

How do I calculate the boundary of the game window after transforming the view?

My Camera class handles zoom, rotation, and of course panning. It's invoked through SpriteBatch.Begin, like so many other XNA 2D camera classes. It calculates the view Matrix like so: public Matrix ...
6
votes
3answers
608 views

How do I make a moving object stop smoothly at the end of a path?

There are a dozen ways I could word this question, but to keep my thoughts in line, I'm phrasing it in line with my problem at hand. So I'm creating a floating platform that I would like to be able ...
2
votes
2answers
417 views

One-way platform collision

I hate asking questions that are specific to my own code like this, but I've run into a pesky roadblock and could use some help getting around it. I'm coding floating platforms into my game that will ...
4
votes
1answer
1k views

Friction in 2D game

I'm developing a 2D platformer, although this question could probably apply to just about any 2D type physics; What is the equation for friction? I have sort of a hacky type of friction set up in my ...
5
votes
1answer
403 views

2D Magnet-like repelling behavior

If somebody wanted to develop a system between two intersecting rectangles so that the rectangles would, in a gradual process, push eachother away from one another until no longer intersecting, with ...
0
votes
1answer
706 views

Proper way to use a RenderTarget2D to draw multiple textures?

In the process of trying to resolve a split screen issue, I've been trying to use a RenderTarget2D to draw a portion of my scene to a Texture2D, and then again to another Texture2D, but the end result ...
1
vote
1answer
127 views

Possible to draw a select portion of a render target? (in XNA)

I'm going to try to do this in reverse fashion and skip straight to the punch line, and then give the back story afterward: Is it possible to, after drawing a scene to a RenderTarget2D, only draw a ...
1
vote
1answer
503 views

default xna 4.0 gametime don´t works well for 2D physics

I am developing a game using Visual Studio 2010 and XNA 4.0, after advancing to some extent with the project (a platform based 2d platformer msdn starter kit) I got to test it on different computers ...
4
votes
2answers
1k views

How to create biomes

I am creating an 2D XNA Tile Based Platformer. I have a tile engine and a world/terrain generator. However, I am trying to create biomes or areas, For example, Desert in one part of the world, ocean ...
1
vote
0answers
198 views

Sprite sorting issues

I apologize for the vague title, I'm not sure how else to phrase this problem. I am using tIDE to assist me in my game's world development. To give a dynamic effect to map layers within tIDE, it has ...
2
votes
1answer
986 views

Handling hitboxes

So I have an issue that I'm laughing at myself about, because it really seems like it should be something that I should be able to figure out pretty quickly. I am designing a 2D action platformer; I ...
1
vote
1answer
438 views

Best practices in managing character states

While in development of a character, I feel like I'm digging myself deeper into a hole every time I add more functionality to him, creating more bugs and it seems like my code is tripping over itself ...
0
votes
1answer
246 views

How to break out of if statement

I'm not sure if the title is exactly an accurate representation of what I'm actually trying to ask, but that was the best I could think of. I am experiencing an issue with my character class. I have ...
4
votes
3answers
7k views

2D Tile-based Collision Detection

I've been planning an indie game project for a while now. I'll summarise it for you so I can get right to the question. It's done entirely using the latest version of XNA through Visual Studio. ...
2
votes
1answer
458 views

XNA: Good way to queue up animations

I'm writing an AnimatedSprite class that has an Animation object (which itself contains a sprite sheet). The AnimatedSprite plays certain animations during key input. My problem is that how do I ...
3
votes
2answers
2k views

XNA: Draw Bounding Box around Sprite

I'm just starting with XNA and I wanted to draw Debug Lines around my Texture/Sprite to help me. Is there an easy way to do it with SpriteBatch? I haven't used the GraphicsDevice yet to draw.... ...
1
vote
2answers
1k views

2D Particle Explosion

I'm developing a 2D action game, and in said game I've given my primary character an ability he can use to throw a fireball. I'm trying to design an effect so that when said fireball collides (be it ...
3
votes
2answers
749 views

2D wave-like sprite movement XNA

I'm trying to create a particle that will 'circle' my character. When the particle is created, it's given a random position in relation to my character, and a box to provide boundaries for how far ...
6
votes
1answer
2k views

Sidescroller variable terrain heightmap for walking/collision

I've been fooling around with moving on sloped tiles in XNA and it is semi-working but not completely satisfactory. I also have been thinking that having sets of predetermined slopes might not give me ...
2
votes
1answer
252 views

2D Object 'Targeting' / 'Selecting'

I'm currently working with C# with the XNA framework. I'm trying to create a list of objects that are individually target-able after they are created and set in a list and displayed on a tile map. ...
2
votes
1answer
2k views

Why isn't my sprite being drawn in the correct position in XNA?

Sorry if this has been asked before, but I can't seem to find it here. I'm trying to make an asteroids clone in XNA. I took the Game State Management project and am making new classes for things like ...
12
votes
1answer
1k views

How can I create gradiented Fog of War?

I'm creating a top down 2D RTS game for educational purposes. Currently, I'm really just copying Starcraft's design/ideas. I've decided I should probably implement Fog Of War too. My expectations: ...
1
vote
2answers
1k views

Creating 2D billiard game with realistic movement

I'm new to XNA and game programming. I'm creating a 2D billiard game and I want to add balls with realistic movement (like 3D). Is it possible to achieve this without using 3D models? I only want to ...
1
vote
1answer
2k views

XNA 4.0 - Mixing 3D and 2D - SpriteBatch putting weird alpha texture over whole scene

I am working on a game in XNA 4.0 that has been entirely in 3D so far but now I want to incorporate a HUD. I have tried doing a simple test using spriteBatch as such: spriteBatch.Begin(); ...
0
votes
1answer
668 views

Some help understanding and modifying a 2D shader

I have a similar question as the one posed here, except that I don't wish to use a 1D Color Palette. I simply wish to have it display 1 color of my choosing (red, for example). I plan to use this ...
3
votes
2answers
646 views

XNA 4.0: Trouble Aligning an Animating Sprite (Texture Origin)

I'll try to explain this as best as I can. I'm trying to build a game where there exists a "Surfer" who is surfing down a rail. I have a sprite sheet for the surfer however I have been running into ...