Tagged Questions

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

2
votes
1answer
1k views

How to resolve concurrent ramp collisions in 2d platformer?

A bit about the physics engine: Bodies are all rectangles. Bodies are sorted at the beginning of every update loop based on the body-in-motion's horizontal and vertical velocity (to avoid sticky ...
20
votes
7answers
2k views

Optimizing gravity calculations

I've got a bunch of objects of varying size and velocity which gravitate towards each other. On every update, I have to go over every object and add up the forces due to gravity of every other object. ...
1
vote
1answer
664 views

Is there a 2D soft-body physics engine for Flash?

I'd like to write a small physics game by using ActionScript, but do not want to write my own physics engine. Does anyone know a ready-to-use 2D soft-body physics engine with a Flash port?
2
votes
5answers
961 views

How do I set up moving platforms in a 2D side scroller to interact with the player properly?

Edit: I changed the way that gravity was applied so that it is applied even when a player is standing on a block, so instead of the game outputting that you are stepping on a tile as true and false ...
6
votes
3answers
2k views

Is there a good existing starting point for realistic 2d racing car physics?

I'm trying to get a realistic behaving racing car into my 2d top-down game. Making a very simple car that drives around is straight forward but I want a reasonably sophisticated model that models ...
2
votes
3answers
1k views

How do I move a 2D top-down racing camera smoothly and show what's ahead of the player?

I'm trying to make a camera that follows a race car. Right now, I'm smoothing the camera movement out by moving the camera's position a fixed percentage lerp'ed from the camera's position to the car's ...
20
votes
3answers
1k views

How does one avoid the “staircase effect” in pixel art motion?

I am rendering sprites at exact pixel coordinates to avoid the blurring effect caused by antialiasing (the sprites are pixel-art and would look awful if filtered). However, since the movement of the ...
3
votes
1answer
10k views

How to use rigid bodies for characters?

First off, I am making a game similar to SSB, which relies heavily on physics, even though it is a sidescroller. I am currently using Unity. In Unity there are "character controllers" which are used ...
17
votes
1answer
3k views

Ideas for 2D Water Simulation

I am looking for any input on simulating water in 2D, against a rather large (call it) blocked/not blocked array (viewed from the side). I have come up with the following ideas: Cell Automata Do a ...
2
votes
3answers
2k views

Car movement in arcade racing game

I am finishing a very basic 2D racing game with top-down perspective. I can't get the appropriate formulas to make the movement of the cars fun and addictive... Do you have tips on how to achieve that ...
3
votes
2answers
994 views

How can I implement revolute (hinge) joints in a 2d physics system?

Further to my previous question on fixed joints, I am now going toe-to-toe with hinge joints in 2D physics. Though the answer to the previous question was excellent, I have come across a few problems ...
4
votes
1answer
2k views

How can I implement fixed joints in a 2D physics system?

I'm developing a simple, 2D physics system to complement an entity/component game object framework. So far, I have implemented some basic, tutorial-level physics. An entity that is affected by physics ...
3
votes
3answers
1k views

Equation to make small number big and big number small (gravity)

I have a sprite that I want to speed up as it gets closer to another object. I really want this to flow well and don't want a series of if statements. All I can think of is to take the distance and ...
4
votes
1answer
1k views

How to make a 2D Soft-body physics engine?

The definition of rigid body in Box2d is A chunk of matter that is so strong that the distance between any two bits of matter on the chunk is completely constant. And this is exactly what ...
2
votes
1answer
491 views

Shapes and sprites in SVGs

I understand SGV images are used in 2D games to store shape data for the physics engine of the game. I'm unsure though, should the raster sprite also be stored in the SVG or should it be separate? ...
2
votes
2answers
484 views

Physics in a 2D oblique perspective game

So, just to clarify, because I'm still fuzzy on the terms for perspectives in older games myself, examples of an oblique perspective can be seen in many older RPGs (Earthbound, Final Fantasy, Secret ...
-1
votes
1answer
668 views

Best Android gaming engine for Billiards game? [closed]

What is the best engine/way to go with when implementing a 2D billiards game? I am thinking about Emini Physics Engine, which is free for use and stuff, but maybe you can give me some pitfalls about ...
5
votes
1answer
1k views

Creating similar effects of Geometry Wars in 2D only

I want to create a game with similar effects to that of "Geometry Wars"... for those who have never played the game, basically, massive amounts of 'bending' and 'warping' effects are done on the ...
12
votes
3answers
4k views

2D game collision response: SAT & minimum displacement along a given axis?

I'm trying to implement a collision system in a 2D game I'm making. The separating axis theorem (as described by metanet's collision tutorial) seems like an efficient and robust way of handling ...
8
votes
3answers
949 views

Tiling Physics using Farseer

I'm having a problem with the Farseer Physics Engine, where in a tiled environment, my object will at times interact with corners of others objects, even if they align perfectly. I've read about ...
11
votes
4answers
662 views

How to get object to lose less velocity as its speed increases

I'm developing a game in Flash and I need a little help. It can be considered a math problem. My object is flying with speed X and my object can collide with stones. When it collides with a stone, I ...
1
vote
1answer
2k views

How can I cancel a contact in a b2ContactListener?

To know when contacts happen we can derive from b2ContactListener and implement our own solution which is great. I'm wondering is there anyway we can cancel a contact, that is to say when we hit begin ...
1
vote
1answer
1k views

Bodies are colliding but refusing to rotate in Box2D

I'm running box2d in C++ and hooking it up to C# via p/invoke. All physics stuff occurs in C++. My problem is that bodes know when they are colliding and do so with great precision. However if I have ...
4
votes
3answers
583 views

2D physics library that supports curved surfaces and inverse or boolean shapes?

I've been using box2D for a few months, but I now badly need a physics library which can use boolean shapes (ie; cutting a circle out of a square) and/or curved surfaces. Does anyone have any ...
2
votes
1answer
587 views

Need help with collision detection/resolution in a 2D simulation of 'worm-like' creatures

(originally posted this on regular stack overflow, somebody pointed this forum out :-) ) Hi there, I'm implementing a physics engine for the simulation of worm-like creatures. Problem is, is that ...
1
vote
1answer
2k views

2D Physics Engine for Platform Games - Riding on a Platform

I have a number of questions relating to using a 2D physics engine in a platform game, but one main one that I'm grappling with at the moment. I managed to somewhat integrate the Physics2D.Net engine ...
1
vote
1answer
919 views

Android Fling Gesture, Animation And Collision - Resources?

I'm starting work on a 2D Android game where the player will put their finger on a game piece and do a fling gesture to throw the piece across the gameboard. I've gone through some Android ...
1
vote
2answers
2k views

Box2D Platform body not moving player body along with it

I am creating a game using Box2D (Javascript implementation) - and I added the ability to have a static platform, that is moved along an axis as a function of a sine. My problem is when the player ...
5
votes
3answers
630 views

Physics for Android Game

I'm making a 2D game for the Android phone, one that involves falling balls. I want to use a physics engine to properly simulate the balls falling and hitting other objects. I'm currently using ...
5
votes
2answers
825 views

Collision response for 2D racing game

The title is fairly self-explanatory. I have a 2D racing game that utilizes per-pixel collision detection (the track is essentially two bitmaps, one for the graphics, one for collision data). The ...
4
votes
2answers
713 views

Tracking Object Position - Firing on a Trajectory

How can I calculate the position of an object after "firing" it from a fixed point? I am to create a small game - most likely with canvas (pure HTML, JS based) or Adobe Flash - in which the player ...
-4
votes
3answers
803 views

Homemaking a 2d soft body physics engine

hey so I've decided to Code my own 2D soft-body physics engine in C++ since apparently none exist and I'm starting only with a general idea/understanding on how physics work and could be simulated: ...
6
votes
2answers
2k views

2D soft-body physics engines?

Hi so i've recently learned the SFML graphics library and would like to use or make a non-rigid body 2D physics system to use with it. I have three questions: The definition of rigid body in Box2d is ...
5
votes
4answers
585 views

Channelling an explosion along a narrow passage

I am simulating explosions in a 2D maze game. If an explosion occurs in an open area, it covers a circular region (this is the easy bit.) However if an explosion occurs in a narrow passage (i.e ...
2
votes
2answers
865 views

Physic of an arrow in flight

What are the formulas which represent the horizontal and vertical displacement of an arrow in flight (as well as it angle)? I would like to make sure that I take into consideration the arrow's fluid ...
7
votes
6answers
419 views

Determining player.isFalling() through change of y?

I'm currently using Box2D and my character is a bunch of fixtures in Box2D. I was wondering if, to determine if a player is falling, detecting a change in Y position would be appropriate? Are there ...
3
votes
1answer
388 views

Moving object through nodes in Quadtree

I'm working on my own quadtree for use in games for physics (collision detection to be exact) but am unable to move an object from one node to another node. What I'm doing is if some object is to be ...
0
votes
1answer
719 views

2D game physics, doing it right

I have a ball that you can make jump, I have a sneaking suspicion I'm doing this wrong. It works now, to the extend that gravity pulls the object down toward the ground, but I'm having trouble ...
1
vote
4answers
2k views

Simple physics for modelling ship/submarine movement

for a first iteration of my sim, I need a very basic physics model for ship/submarine movement. I'd guess it might be a good approach to use vectors here (ship heading but also considering sea states ...
16
votes
1answer
684 views

Recreating retro/NES style physics with intentional imprecision

Background: I'm having a problem getting the jump curve correct for a retro platformer remake project of mine. The original game is for the NES, and the player's velocity is stored in two separate ...
1
vote
1answer
2k views

ways to make a physics engine

Hey so i've been looking into real time physics engines, which led me to the crazyLaggoa multiphysics engine by thiaga costa, and brought up the question of: What are some possible ways, ideas that ...
8
votes
5answers
4k views

How can I easily implement swinging in a platformer game?

I'm developing a game in which player can use ropes to swing (just like what Spiderman or Bionic Commando did) and I'm having problem implementing this behavior. Can anyone help me how to do this, I ...
2
votes
1answer
834 views

Converting 2D Physics to 3D

I'm new to game physics and I am trying to adapt a simple 2D ball simulation for a 3D simulation with the Java3D library. I have this problem: Two things: 1) I noted down the values generated by the ...
4
votes
1answer
400 views

How to balance a ball on a rotating plane?

I'm doing some research and I really don't want a physics engine when a simple mechanism will do. I have a ball that will be balanced on a plane. The ball will always be "stuck" to the plane and ...
2
votes
3answers
2k views

2d Collision detecton axis aligned boxes

I have recently run into some trouble with my collision detection. My game is composed of a map made out of axis aligned squares. The player has an x and y velocity, and I want to know how I can find ...
1
vote
1answer
248 views

Mouse joint isn't restricting the ball from going to the other part of the screen

I'm developing a application in cocos2d using the Box2D framework, but unfortunately I am having issues. I'm not able to restrict the orange ball in the half screen area, taking the image below as ...
0
votes
2answers
243 views

How to apply numerical integration on a graph layout

I've done some basic 1 D integration, but i can't wrap my head around things and apply it to my graph layout. So, consider the picture below: if i drag the red node to the right, i'm forcing his ...
8
votes
1answer
3k views

Basic Box2D collision detection

I don't understand how to listen for collisions in Cocos2D/Box2D. Say I have two dynamic circle bodies. One is very small and the other is relatively large. When the small circle collides w/ the ...
7
votes
1answer
556 views

Finding the point of collision

I'm writing a 2D rigid body simulator. The objects being simulated are convex polygons. My question involves how to decide on the "point" of collision, so that when I apply a response force, I can ...
3
votes
2answers
1k views

When and how should I apply forces in a Cocos2D + Box2D game?

I have some small circles just rolling across the bottom of the screen in my Cocos2D/Box2D iOS app. The bodies are dynamic... so I make them roll by applying a horizontal force to the center of mass ...