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

1
vote
0answers
14 views

Unity WheelJoint2D will not rotate when increasing motor speed

I have a wheel joint 2D attached to a game object in Unity: In its associated wheel script I am increasing the motor speed as described in the tutorial. public class Wheel : MonoBehaviour { ...
0
votes
0answers
23 views

How to handle car game circuits in a top-down view?

I'm already using a physics engine (box2d) but i have no idea about how should I implement circuit's path with wall collision. I tought about checkpoints but this doesn't solve the wall collision.
1
vote
1answer
28 views

Spritekit - gradually apply force vector in different direction (space ship turning)

I have a space ship that I'm applying a force vector to using a joystick for control. I would like this to smoothly fly around when I'm switching directions.. Exactly like minisquadron if youve ever ...
0
votes
1answer
88 views

Swinging a sword in Xcode with Sprite Kit

I'm working on making an RPG in Xcode, and I'm having a major gameplay issue when it comes to having my character swing his sword in a way that is realistic and gameplay compatible. Right now, when ...
0
votes
0answers
22 views

Friction effects on ball motion direction when crossing surfaces edges

I have a ball rolling from a high friction coefficient surface (snow) to a very low friction coefficient surface (ice). When the ball crosses the boundary at an angle, I believe it should change ...
1
vote
2answers
98 views

How to detect collision on specific part of the sprite node

I have a spike and a ball is falling down, when the ball touches the top point of the spike, I want to make the ball invisible, and when it touches on the other part i.e on the sides I don't want to ...
2
votes
1answer
75 views

Best practice for organizing the physics of objects?

Apologies because this is a long post and I am inexperienced. I would really appreciate the input from some experienced developers. These are my two goals for this project: To learn the best ...
0
votes
1answer
48 views

Trajectory Projectile with Collision Detection

Right now I am trying to create projectile for cannon in which I want to detect collision also. At present I have simple working projectile after using two references Unity – How to display ...
2
votes
1answer
57 views

Frame-rate independent friction on movement in 2d game

I have been trying to implement a simple physics system for a 2D space game I am making. I have it pretty much working, but I have encountered an issue with the way I apply friction. I have tried ...
0
votes
0answers
19 views

Box2D collision damage calculation from postSolve or not?

I'm using postSolve to get impulse then calculate damage base on that impulse. But there's some issue: Stability The damage isn't stable. When the same ball is hitting with same speed, the damage ...
1
vote
2answers
87 views

How to Calculate Velocity in a 2D space game

I am currently using screenpos.X = (float)(screenpos.X + velocity * Math.Sin(r)); screenpos.Y = (float)(screenpos.Y - velocity * Math.Cos(r)); For my Movement with r being the Rotation in Radians. ...
0
votes
0answers
46 views

Particle friction with variable timestep in XNA

Alright, so I'm working on an engine of sorts in XNA (yes, it's deprecated, I know) and I'm implementing my own particle system. I've defined a "ParticleEffect" such that when it's supplied a GameTime ...
2
votes
1answer
99 views

Inverse Explosion with Unity2d

I am currently trying to make all other objects push away from the player when the player explodes. It currently works, but it pushes close objects a little and far objects very far. What I want is ...
0
votes
1answer
92 views

Resolution independent physics

I'm making a game like Doodlejump but don't know how to make the physics scale on multiple resolutions. I also can't find anything related to this on Google. Right now I'm scaling the game using ...
1
vote
1answer
64 views

Reflection velocity

I'm trying to get a moving circular object to bounce (elastically) off of an immovable circular object. Am I doing this right? (The results look right, but I hate to trust that alone, and I can't ...
0
votes
2answers
162 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 ...
0
votes
1answer
80 views

Bouncing ball slowing down over time

I use the unreal engine 4 to bounce a ball off of walls in a 2D space, but over time the ball gets slower and slower. Movement happens in the tick function of the ball FVector location = ...
1
vote
1answer
53 views

Sprite Kit - containsPoint for SKPhysicsBody?

I have a ball bouncing around the screen. I can pick it up and drag it onto a "bucket". When my touches finish, I use the containsPoint function to check and see if I have dropped the ball onto the ...
-1
votes
1answer
62 views

simple collision detection with box2dweb

im beginner in box2dweb that version of box2d for javascript i wrote simple gravity system and i want to detect the collision between the box and the ground , when the falling box hit the ground ...
0
votes
1answer
58 views

Can I have a fixed-angle sprite with a non-fixed-angle CircleCollider2D?

In Unity2D, can I have a fixed-angle sprite with a non-fixed-angle CircleCollider2D? I would like to move my character using the circle physics (without fixed-angle), but display him always as if he ...
0
votes
0answers
32 views

Box2d not showing consistent behaviour with sprites

Box2D newbb here. My question is in regards to this create js project:http://mboyeman.com/dashingdog/ (runs best in IE...:3) I wrote a function(assignBlockBodies) to give 2D Edges to sprites based on ...
4
votes
2answers
435 views

How to circle a target at a constant distance

I have an AI ship that stops approaching when it gets within firing range, and starts strafing around its target. The problem is that it doesn't circle its target very well. The following code ...
1
vote
2answers
206 views

Platformer Collision Detection Order

I'm attempting to create a 2D Platformer Game and I'm having difficulty with the physics I have implemented. Each loop my code does the following: Apply the physics to a temporary X and Y ...
1
vote
1answer
102 views

Mixing interpolation with extrapolation in multiplayer game

I am creating a multiplayer drag racing game and have difficulties mixing extrapolation and interpolation. To save network bandwidth i am getting information from the opponent only on his button ...
2
votes
1answer
113 views

2D physics rotation w/ XNA

I'm creating a simple game with space ships made of blocks that are all the same size. After having looked at this: Calculating the rotational force of a 2D sprite I have created the following code ...
2
votes
2answers
107 views

How do I implement friction in a billiards game?

I'm having trouble implementing friction in a billiards game. Currently, the ball only slows on collision with the edges, but I also want some friction with the background. How can I implement ...
1
vote
2answers
47 views

Custom Physics: Preventing objects from losing velocity in certain situation

Illustration: http://s22.postimg.org/7agd30vap/Untitled.png So the little box is my character. The red arrow shows the current velocity(Some force to right + gravity). Below it are 2 blocks which has ...
1
vote
0answers
59 views

Storing rigid body collision shapes in local or world coordinates

I'm writing the beginnings of a lightweight 2d rigid body engine (in javascript, as a hobby project), and i'm debating whether to store collision shapes in local or in (updated as needed) world ...
0
votes
1answer
77 views

Mobile: Physics and movement actions

I've been using spritekit for a while for a few small games. One thing I've noticed is that spritekit is the first game framework I've used that allows me to apply move actions to physics bodies. ...
1
vote
2answers
89 views

How to know when all 2d rigid bodies have stopped in unity3d?

Is there anyway to know if all 2d rigid bodies in untiy 3d phisics world have stopped?
0
votes
0answers
93 views

Moving objects smoothly, bad perfomance

I just finished developing my mini-game on Android and I got some questions about perfomance and generally "how to": If I have 25+ objects on the creeen (just a polygon with 7-8 angles) its starts to ...
2
votes
1answer
107 views

How do I convert a partially transparent image into polygons?

I'm using GLEE2D, a level editor allowing me to import images, scale them, rotate them, and position them onto layers and export the data into XML format. However, it does not tell me objects' ...
-1
votes
1answer
35 views

How to predict physics movement [duplicate]

How to predict the movement of the body when a force is applied on it like in the https://play.google.com/store/apps/details?id=com.game.basketballshoot I have attached screen shot as reference.
0
votes
0answers
93 views

How to find correct offset to adjust sprite to the position of box2D body after rotation

I am trying to implement phsyics with the as3 box2d port. I currently have a b2body for each of some certain sprites in my game and I am able to update the sprite's positions correctly from the ...
0
votes
0answers
41 views

Apply impulse to ball to a fixed height Jbox2D android

I have to hit a ball to a fixed height repeatedly as shown in the following image. This game is similar to 1983 Hitit The difference is the hitting y axis will be variable. I wanted to hit the ...
0
votes
0answers
18 views

Artificial physics : ball angle bouncing (Vector2) [duplicate]

My question is : how can I manage to move my object (ball) on a trajectory , and onContact with another object, it bounces, respecting the angle
1
vote
1answer
272 views

Movement and rotation of bodies in top down game

We are developing a 2D top down game with libgdx using the included box2d as physics engine. We don't want our bodies to accelerate but to instantly move with the wanted velocity. The bodies are ...
1
vote
1answer
75 views

Calculating the point(s) at which two moving objects are a certain distance from each other

Problem This is similar to a Closest Point of Approach calculation, but instead of the closest point(s), I want the points at which the objects are a given distance away from each other. (Imagine two ...
3
votes
1answer
106 views

Calculate point of circle–circle collision between frames

I need to find the exact XY coordinate where a circle collides with another circle calculated between frames. This means that I take the coordinate of the moving circle on the previous frame and take ...
7
votes
3answers
1k views

Is a separate thread for game loop compulsory for simple games?

I am new to game development. In order to learn I am recreating this game on android platform. You can observe the game-play video at the above link. It is a simple game. I have read a lot of ...
2
votes
1answer
93 views

How to impale and stack targets correctly according to the collider and its coordinate?

I'm making another simple game, a catch game, where a spawning target game object must be captured using a skewer to impale it. Here how: At the start, the falling object (in red) will fall in a ...
4
votes
1answer
438 views

Algorithm for randomly generating reachable platforms

I want to randomly generate reachable platforms on the fly for a 2D game. Right now, I am just creating platforms at random x,y positions. Only 4 platforms can exist at once, so once the 5th one is ...
0
votes
1answer
240 views

How do I determine a good path for 2D artillery projectiles?

I'm building a little "tank wars" game (like this one). I understand the math, and I am able to define a parabola from the launcher to the objective I want to reach. The parabola depends on the ...
0
votes
0answers
81 views

Calculate mass moment of inertia of two 2D polygons

For a small 2D physics engine I need to know the following. I wasn't able to find an answer even after a week of research. Hope you can help me. I have multiple concave 2D polygons that are tight ...
3
votes
1answer
97 views

Calculating impulse with multiple collision points

In my amateur 2D rigid body physics engine for a game I react on collisions between two bodies with an impulse j (formula 11) as explained here. To calculate this impulse I need one contact point P ...
4
votes
1answer
218 views

How do I simulate a trampoline?

I'm quite new to game development. I was pretty impressed with the elastic effect I saw in this flash game when the ball hits the trampolines and I'm wondering how to recreate it. I've done some ...
1
vote
2answers
169 views

Collision detection via adjacent tiles - sprite too big

I have managed to create a collision detection system for my tile-based jump'n'run game (written in C++/SFML), where I check on each update what values the surrounding tiles of the player contain and ...
5
votes
3answers
320 views

How do you calculate the rotational velocity of a flying object?

When a arrow shaped object is fired it slowly adjusts it's rotation to match the direction it is moving. But what is the actual physics behind it? The question is: How many degrees does the ship ...
0
votes
0answers
49 views

Lateral Friction Phisics

I am trying to create a physics engine for my game, and need to cancel out any lateral velocity for when entities turn. I have tried to mimic this page's example, but it is not working. I have objects ...
0
votes
0answers
46 views

Memory Management on Physic Body Frames in Unity

Compared from the Android programming with the help of LibGDX and Eclipse programming software in making 2D physics based game from this previous question, what if I'm throwing lots of game objects ...