Relating to the motion of objects through space (in 2 dimensions (x,y)) and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

learn more… | top users | synonyms

0
votes
2answers
123 views

very simple math destination and speed calculation

My player goes to (destinationX, destinationY) His position is: (x,y) and the player has an update event function update() { this.x = this.x + dx; this.y = this.y + dy; } what is the formula ...
5
votes
1answer
174 views

Tracing a 2d path through multiple gravity fields

For a projectile starting at origin O, an initial velocity V, and several stationary planets P[n], how would I pre-calculate and store the path it would take without actually stepping through each ...
0
votes
1answer
122 views

Unit conversion for physics

I'm doing the physics for a 2D game which visuals are represented in openGl. Gravity is 9,8 m/s^2, how do i convert that to my screen size? OpenGl sets width to -1 to 1, and does aspect ratio of the ...
3
votes
0answers
90 views

How can I smoothly rotate a joint to an angle? [duplicate]

I would like to set the speed of my Box2D revolute joint on every update such that it rotates to a desired angle and stops. It should ramp down as its angle approaches the desired angle. My first ...
1
vote
1answer
100 views

How to show the bow string stretching animation (?)

I was wondering how the animation in the angry birds of pulling the slingshot is done. One similar animation is available in this game but with a bow and arrow. I think both of them use the almost ...
2
votes
4answers
294 views

Using forces to reach a specific velocity

In my game, I currently move the player by directly setting its velocity on key press events. This makes the game feel very responsive and allows the user to quickly change direction. However, I ...
3
votes
1answer
358 views

How to handle jumping up a slope in a runner game?

In an 2D endless runner, what should happen when the player is running "too fast" up a slope and jumps? For example, in a "normal" case: .O. . __..O_____ . / . / O/ _/ If he is moving ...
3
votes
3answers
415 views

2D game with 3D collision?

How do they do this bounce? Looks awfully complicated in 2D.
4
votes
1answer
163 views

How to manage sleep/awake state of physics body

I have a loop, which updates all the physics, inside the loop I'm updating the position of the objects, first thing is the gravity, which pulls all the objects to the bottom. Now my question is, how ...
1
vote
3answers
414 views

Bouncing ball isssue

I am currently working on the 2D Bouncing ball physics that bounces the ball up and down. The physics behaviour works fine but at the end the velocity keep +3 then 0 non-stop even the ball has stopped ...
2
votes
1answer
139 views

How to calculate new velocities between resting objects (AABB) after accelerations?

lately I have been trying to create a 2D platformer engine in C++ with Direct2D. The problem I am currently having is getting objects that are resting against each other to interact correctly after ...
0
votes
0answers
105 views

Bouncing objects against the side of the screen

I want to have certain circular objects bounce against all four sides of the screen. After searching a lot on the internet, I found the following formula: Vout = Vin - ((1+e) *dot(Vnormal, Vin) * ...
0
votes
1answer
207 views

Issues calculating frame independent movement

I'm developing a Breakout style game in C++ using SDL. The problem so far is that the ball slows down and speeds up for no particular reason. The slowdowns usually last a few seconds. EDIT : When ...
3
votes
1answer
522 views

How to implement throw curve with virtual height in a 2D side-view game

I am working on a 2d side-view soccer game that looks like this image: But now I stuck on how to implement parabola pass ball. I have found many questions corresponding to my problem: Calculating ...
4
votes
3answers
125 views

Propel entities at some angle (depending on explosion's position)

I have a 2D platformer. There are multiple particles that are just 1x1 colored pixels. Let's assume there are 256 particles laid out as a 16x16 cube. Say I popped an explosion right in the middle. All ...
0
votes
1answer
195 views

Resolving a collision between point and moving line

I am designing a 2d physics engine that uses Verlet integration for moving points (velocities mentioned below can be derived), constraints to represent moving line segments, and continuous collision ...
0
votes
4answers
2k views

Smooth jumping in 2D platformers [duplicate]

I have a very simple 2D game, similar to old-school Mario or Metroid. I'm having a lot of trouble figuring out the proper way to handle player jumping. I've tried several different methods. The first ...
0
votes
3answers
531 views

Box2D body jitters when colliding with static body

I am developing a game where a body is moved within the scene using touch. The scene has a boundary wall made up of static rectangular bodies. When I move the object along the boundaries, on ...
1
vote
1answer
863 views

2D Destructible Terrain with Box2D / Cocos2D -> Image Tracing

Bear with me as this will be a rather lengthy post. For the last month I have been working on an open source Cocos2D, Box2D Destructible Terrain Engine. I have some questions regarding its ...
25
votes
5answers
2k views

Simulating pressure in a grid based liquid simulation

I have a 2D grid based water system in my XNA game, we have a method using cellular automata to simulate water falling and spreading. Example of water flowing down a slope: Each tile can contain a ...
-1
votes
1answer
369 views

How is destructable terrain made in SDL?

I'm looking for terrain that gets removed in chunks (like in Worms, of instance). How do you do this in SDL?
1
vote
1answer
716 views

Box2d contant speed before and after collision

I want to make my body fly at constant speed, how to make it fly at constant speed before and after collision? I set restitution of my body to 1.0 but after some direct and powerful collisions my ...
3
votes
1answer
407 views

Sensor based vs. AABB based collision

I'm trying to write a simple collision system, which will probably be primarily used for 2D platformers, and I've been planning out an AABB system for a few weeks now, which will work seamlessly with ...
3
votes
1answer
466 views

How to implement server side physics?

I am working on 2-player 2d sidescroller. How should I implement the physics on the server? Use one world for every game or use a big world in which I add every 2 player that start a game? I have ...
1
vote
1answer
388 views

Making Ball Fling in a Curve Direction

I was wondering how to figuring out how to slice a ball (banana kick) by flinging it curve-ways. However, according to the LibGDX's gesture listener, the method for flinging only focuses on a straight ...
0
votes
1answer
162 views

Formula throwing a ball to destination [duplicate]

I am throwing a ball using this: double v, vx, vy, alpha, t2 = 0; if (Keyboard.GetState().IsKeyDown(Keys.Up)) { alpha = MathHelper.ToRadians(60f); v = ...
0
votes
1answer
452 views

Moving a Box2D object in the direction it is facing using applyForce [duplicate]

I'm trying to apply force to a polygon physics object to move it. Whilst I can get it to move upwards easily enough, I'm trying to get it to move in the direction in which it is pointing. Here's my ...
0
votes
3answers
432 views

how can we define dynamic Path of ViewObject(Bitmap) On Canvas

I am Currently working on One 2D Android Game, In this game One ViewObject(Bitmap) is moving Across Screen On Parabola Path Like in this Image, But this Path is Static, the Static path is getting ...
1
vote
1answer
102 views

Ring and Pole - Box2d

How I can make a b2Body in box2d so that it could form a ring which does not collide from the center just like a ring. like when we flick the object and there's another body (like pole), the pole can ...
3
votes
1answer
1k views

Movement & Physics in an entity-component system

I'm currently playing around with entity-components systems and got started on the movement/collision/physics parts and would like to have some pointers! It's a basic 2D sidescrolling game, with the ...
2
votes
1answer
2k views

AndEngine - Moving Rectangle using Accelerometer

I'm learning how to create games with this great engine and I'm trying to put my knowledge in order to create a simple game. My first goal is to make a Rectangle moving using accelerometer and create ...
7
votes
1answer
897 views

How to simulate feather fall in box2d?

I am working with AndEngine with Box2d extension, but general answer or a concept idea will be appreciated too. I have feather-like objects in a 2D side view world that I want to be part of the ...
-1
votes
1answer
995 views

“Car” movement in 2D dimension [closed]

I am searching for a simple tutorial how to add arcade car physics for my game. Exactly same user units behaviour i found in next games: Tank Hero: Laser Wars Death Worm: Video: ...
1
vote
3answers
234 views

Gravity independent of game updates per second

Edit Just for clarification, my sprite's 'movement' isn't the problem. If I set my Time variable to 4 seconds, then it will cross the screen in exactly 4 seconds regardless of logic updates rate per ...
4
votes
3answers
872 views

Calculating buoyancy force

I am trying to simulate a buoyancy force for objects submerged/suspended in a fluid in a 2D environment. According to Game Physics: Engine Development: How to Build a Robust Commercial-Grade Physics ...
1
vote
2answers
445 views

Throw object towards predefined place? [duplicate]

I have a 2D side-view game with object attributes such as x, y, speedX, etc. Now I want to throw a given object from any place on the screen onto a defined goal place, in such a way that its ...
0
votes
1answer
147 views

Collision and gravity problems

So this is an easy question. I need to implement gravity in my game but where I'm stuck is what variables do I need in my Entity object for the calculations and a good algorithm that I can use for ...
1
vote
1answer
363 views

Swarm/crowd movement with box2d?

Apart from using b2Body::setTransform(), are there other ways to move a body around while keeping its dynamics ? I want to move several bodies at the same time into one direction, pretty much like ...
3
votes
1answer
399 views

Realistic 2D Planetary Physics Engine?

I'm doing a spaceflight simulator in C++ (using Allegro 5), and I realised that I could just use a physics engine instead of writing my own physics. So that's what I'm doing. Since this is going to ...
1
vote
2answers
154 views

Moving Sprite With Physics Frame

Normally, a physics frame in pink (see image below) gives the body for detecting hit signal. It usually either falls down or lifts up depending on the gravity orientation. The question is: Is it ...
4
votes
2answers
330 views

Creating stable tentacle structures

I am using verlet integration to simulate some tentacles. So far it works great and I am satisfied with how it looks in general. Here is how a tentacle is built: The very stiff sticks are colored ...
1
vote
0answers
413 views

Why won't my Box2d bodies collide? [closed]

I'm doing something wrong when trying to get bodies to collide using jBox2d & Slick2d. Here is have just my basic init, update, and render methods. Render and update seem to work fine for drawing ...
3
votes
1answer
390 views

Fluid Particle Grid

So recently I have been looking at some fluid simulation techniques, specifically Smoothed Particle Hydrodynamics. One of the key components is a grid to avoid O(n^2) searches. I have been having some ...
0
votes
2answers
312 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 ...
1
vote
2answers
184 views

limiting jump forces to achieve a maximum jump height [duplicate]

A player and the world are modeled using a physics engine. Jumping is modeled by applying a vertical upward force to the player's physics body when the jump button is pressed. The upward force is ...
-1
votes
1answer
127 views

Bullets Spawning in same direction [closed]

I'm using XNA to make a Bullet Hell Shooter game, and I'm running into some troubles when I try to change the direction in which the bullets move. Been trying to debug for awhile, but haven't gotten ...
1
vote
1answer
331 views

Debug Render In Cocos2d Android

I want to implement debug render for cocos2d android.So I can view how bodies are created. Right now I use gdx.jar file for box2d and load that jar file following way. static { ...
0
votes
2answers
157 views

Problem with sensor in box2d [closed]

I have two bodies: one green static sensor (spikes) and one orange dynamic body (brick). I have bullet and it's a dynamic body too, but with bullet flag set. My problem is that when the bullet is ...
2
votes
1answer
496 views

Simple 2D hair simulation/manipulation

I would like to simulate very simple hair in a 2D environment, and will need to be able to "brush" the hair. What I want to do: A 2D character is facing squarely towards the player. The player can ...
0
votes
2answers
85 views

Checking bounds of a quad

I want to know how would I tell if a quad touches another quad in my game built in Slick2D. I have a class that I named "Bounds" which has 4 "Point" objects which just store an X and a Y value and a ...