# Tagged Questions

117 views

### How can I simulate a magnet that attracts a ball in a 2D enviroment?

I am making a top-down game where you have to move a ball from point A to point B. You are attracting the ball using magnets that are standing still. The ball needs to get pulled by multiple magnets. ...
135 views

### How to correctly handle multiple movement key presses resulting in double the speed?

I am trying to implement acceleration and drag into my top-down 2D game. The player can move using the WASD keys. Acceleration works fine, but the way I handle the directional velocity causes the ...
174 views

### How do I make a sprite appear to sway with the wind?

I'm trying to find a method to simulate the effects of wind on various sprites in a side-view 2D scene. What relatively simple technique could I use for this? What I have in mind is to give these ...
347 views

### Increasing efficiency of N-Body gravity simulation

I'm making a space exploration type game, it will have many planets and other objects that will all have realistic gravity. I currently have a system in place that works, but if the number of planets ...
1k views

I'm building a space exploration game and I've currently started working on gravity ( In C# with XNA). The gravity still needs tweaking, but before I can do that, I need to address some performance ...
141 views

### Farseer: Shooting a ball in a certain angle?

How can I shoot a ball in a certain angle? When I press the Space key, the ball should be shot in a 45 degree angle. How can I do that?
204 views

### Farseer: Difficulties with implementation of DebugView

I added the project "Farseer Physics Engine 3.3.1 HelloWorld XNA\DebugView XNA\DebugView XNA.csproj" to my solution explorer in Visual Studio. In addition, I added a reference to my project and the ...
69 views

### Farseer: RemoveBody is not working [closed]

I want to remove bodies after they touched the character(playerrect). But the bodies get not removed. I set a breakpoint in the following line but it doesn't get yellow: ...
131 views

### Farseer: How can I remove a body?

I have many sensors(coins) in each level and I want to remove the sensors(coins) when the player rectangle(Mario) touches them. I check in OnCollision if Mario touches a coin, if he touches it, it ...
51 views

### Farseer: Difficulties with ContactListener

How can I register the ContactListener in XNA? In the box2d manual is written: 9.4 Contact Listener ... At run-time you can create an instance of the listener and register it with ...
193 views

### How do I make a tile passable in one direction only?

I want that my character can jump through some of the tiles, like Mario does in this video: http://www.youtube.com/watch?v=zIPYzbNrNhc In this video, Mario jumps up through orange platforms, but ...
318 views

### Farseer: are you missing a using directive or an assembly reference?

I want to create a polygon in Farseer. I found an example in the documentation but it's not working because I get this error message: The type or namespace name 'Vertices' could not be found (are you ...
103 views

### Farseer: Ball is not getting slower

The ball is not getting slower when it rolls over a straight platform. I added friction but that changed nothing, the ball still gets not slower. I want that the ball gets slower and slower and stops ...
187 views

### Farseer: Ball is not bouncing realistically

I created a ball that is rolling over platforms. When it falls from one platform to another, it should bounce just like in real life, but the ball keeps bouncing constantly and I don't know how to ...
30 views

### Farseer physics engine: The name 'ConvertUnits' does not exist in the current context [duplicate]

http://digitalerr0r.wordpress.com/2012/03/11/farseer-physics-in-xna-4-0-for-windows-phone-1/ I tried this Farseer tutorial but I always get that error message in the following lines: ...
145 views

### How to use a physics engine for collision detection? [closed]

I want to use Box2D.XNA or Farseer for collision detection in my 2D game, but I don't know how to start. I added Box2D.XNA to my solution, but I don't know how to create rectangles, circles or ...
303 views

### Getting BEPUphysics to draw its entities

Isn't there a way, to force BEPUphsyics to show what it is doing? I am here with my existing XNA project, starting to put in BEPUphysics, but I am not seeing what it is doing. Take my model for ...
147 views

### Is there any physics engine for XNA? [closed]

I am an XNA game developer. I am now starting to develop physics games on XNA but the problem is that I don't know about any physics engine desinged for XNA. Please if you know about it kindly help ...
915 views

### Implementing a homing missile [duplicate]

I'm having some trouble implementing a homing missile that satisfies what I'm looking for. I have already tried the Seeking and Arrival behaviours described in this link, but none of them were what I ...
185 views

### Creating physics in xna

I am creating a racing game using visual studio 2010 and xna 4.0. I'm trying to create some simple physics so my car sticks to the heightmap I have created within my game world and the model adjusts ...
264 views

### Networked Physics - Interpolation Causes Physics Engine to Explode

A major issue I am encountering right now is that my physics engine (BEPU) and my network interpolation are conflicting with each other. The player is a physics object, and so the physics engine ...
513 views

### Ball bouncing infinitely and constantly

Alright, so I've got hold of some simple physics mechanics, and am currently trying to implement bouncing. Based on the first answer of this question, I've developed the following algorithm: ...
119 views

### Help finding a good XNA physics library? [closed]

I'm looking for a good physics library for XNA. Can anyone help me find something good, simple and easy to learn for XNA?
925 views

### How to make a smooth movement in XNA?

I'm trying to make a nice controls for my game, but I can't achieve enough SMOOTHNESS. if (kbState.GetPressedKeys().Length != 0 && _direction != Vector2.Zero) { ...
332 views

### XNA (BEPU) Physics Performance

Im using XNA 4.0 with the BEPU physics engine v1.2 and I have encountered some performance problems on Xbox. Im not sure if the my mesurements are an expected result of the Xbox (with alot of dynamic ...
3k views

### Get collision details from Rectangle.Intersects()

I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this: // Ball class rectangle.Intersects(paddle.Rectangle); Is there any ...
248 views

### How can I derive force vectors from velocity vectors?

I'm making a 2d shooter ala Geometry Wars. I've got my own simple physics at work driving the background grid and all my entities. To move anything in the world I apply a Vector2d force to it. The ...
8k views

### 2D water with dynamic waves

New Super Mario Bros has really cool 2D water that I'd like to learn how to create. Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
201 views

### Scaling Sound Effects and Physics with Framerate

(I'm using XNA and C#) Currently, my game (a shooter) runs flawlessly with 60 FPS (which I developed around). However, if the framerate is changed, there are two major problems: Gunshot sound ...
220 views

### What is going on in this SAT/vector projection code?

I'm looking at the example XNA SAT collision code presented here: http://www.xnadevelopment.com/tutorials/rotatedrectanglecollisions/rotatedrectanglecollisions.shtml See the following code: private ...
629 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 ...
864 views

### Farseer Physics for Xna missing ConvertUnits class

Im using Farseer Physics with Xna 4.0. Im following a starter guide. It said that to draw, I need to convert the meters to pixels with the ConvertUnits namespace. I looked through all of the engine, ...
629 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 ...
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 ...
423 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 ...
187 views

### 2D Physics Engine to Handle Shapes Composed of Multiple Densities XNA

The game I'm working on involves shapes that might be composed of multiple materials in a variety of ways. Let's just take for example a wooden rod with and sizable tip of iron or say a block composed ...
330 views

### Implementing a wheeled character controller

I'm trying to implement Boxycraft's character controller in XNA (with Farseer), as Bryan Dysmas did (minus the jumping part, yet). My current implementation seems to sometimes glitch in between two ...
1k views

### Correct way to use Farseer Physics in XNA

I am using Farseer Physics for my 2D sidescroller game and I'm not sure how to proceed with it. I currently have a Sprite class (handles nothing but graphics), a GameObject class (contains specific ...
602 views

### Breakout… Getting the ball reflection X angle when htitting paddle / bricks [duplicate]

Im currently creating a breakout clone for my first ever C# / XNA game. Currently Ive had little trouble creating the paddle object, ball object, and all the bricks. The issue im currently having is ...
138 views

### Farseer non-colliding bodies affect eachother

I'm trying to use Farseer to make a tile engine, but bodies that are not colliding with a sprite are still having an effect on it. In this image there is a single sprite(the green box) and a single ...
291 views

### Physics from other games

I'm making a platform engine with XNA Game Studio, and I've solved almost everything about colliding stuff. But now, I'm searching for good physics for the player, I'm trying to emulate characters ...
1k views

### Platformer Starter Kit - Collision Issues

I'm having trouble with my game that is based off the XNA Platformer starter kit. My game uses smaller tiles (16x16) then the original (32x40) which I'm thinking may be having an effect on collision ...
202 views

### How can I stop my Jitter physics meshes being offset? [closed]

I'm developing a C# game engine and have hit a snag trying to add physics. I'm using XNA for graphics and Jitter for physics. I am trying to split the XNA model into it's meshes, then create a ...
3k views

### Ball Physics : Smoothing the final bounces as the ball comes to rest

I've come against another issue in my little bouncing ball game. My ball is bouncing around fine except for the last moments when it is about to come to rest. The movement of the ball is smooth for ...
290 views

### Need help with objects moving toward the player

I am making a 2D game with simple "gravity": everything is just pulled toward 0,0. The speed at which they accelerate towards it is GravityAcceleration up to MaxGSpeed. I also want the player to be ...
328 views

### Why is it that there are invalid “dt” values in physics simulations?

I'm utilising some of NeHe's spring code, and after getting some pretty weird results I eventually realised the source of my error - my "dt" value in my Update function; the value that everything is ...
336 views

### BEPUphysics collision with generated terrain?

I've got randomly generated terrain which is stored in a indices and vertex buffer. How do I go about using this for collision in BEPU? It seems I can do it with a Mesh but it would be a waste to ...
261 views

### Free physics library?

What are some good recommendations? I have a vertex buffer and indices and I want to be able to detect collision between it and a bounding box or another object.