Tagged Questions
7
votes
2answers
808 views
What is the best way to handle simultaneous collisions in a physics engine?
I'm writing a 2d physics engine in javascript so that I can learn more about physics in video games. I have it working correctly for rigid body collisions, except for if any body collides with two or ...
7
votes
3answers
2k views
Web workers for HTML5 game physics simulation?
A bit related to this question.
The idea is to guarantee the same physics behavior as much as possible. Would it be possible to run fixed time step physics on a web worker? The UI would update ...
6
votes
3answers
306 views
How can I change the acceleration of an object to arrive at a particular time?
I'm trying to write some code to change an acceleration factor so a ball will arrive at a destination in a desired time.
The problem is I don't know time (t) but I do know I want it to arrive at (t - ...
4
votes
2answers
856 views
Calculating the angular direction from velocity
I'm trying to calculate the angular direction of a projectile, knowing it's X and Y velocity I can find the magnitude of its movement, but I'm having a hard time wrapping my mind around getting the ...
4
votes
2answers
206 views
Simulate forces on a connected chain
I'm building a 2D space game where the player uses a chain to grab on to nearby asteroids. The asteroids move along a specific path with a constant velocity.
The chain has a maximum length L and ...
3
votes
4answers
2k views
2D Collision in Canvas - Balls Overlapping When Velocity is High
I am doing a simple experiment in canvas using Javascript in which some balls will be thrown on the screen with some initial velocity and then they will bounce on colliding with each other or with the ...
2
votes
1answer
161 views
Box2D: Asteroids-Like Spaceship Physics
I'm new to Box2D (JavaScript) (and the world of physics/mathematics) so I'm having a hard time working out the methods I need to use to make a spaceship act like it does in the classic arcade game ...
2
votes
0answers
231 views
Independent HTML5 Physics Game: Any Feedback? [closed]
I've been independently developing a physics-based HTML5 game. I haven't used any libraries or engines; all the code, including the physics, is my own. It is free for a while on the Chrome Web Store ...
1
vote
1answer
124 views
Simple 3D particle gravity in javascript? [closed]
I'm trying to do some simple gravity handling in my 3D environment (I'm using three.js). I've got some code, but it doesn't work. I'm hoping it's just a silly bug somewhere. Note: This is a ...
0
votes
2answers
626 views
Calculating angle between two vectors to steer towards a target
I have been trying to implement a path following steering behaviour for AI in a 2D racing game.
I have two vectors:
futurePosition represents the predicted future position given the car's current ...
0
votes
2answers
116 views
Physics for space game [duplicate]
I am making a space game where you fly a ship.
I am trying to work out the physics for such a game and so far came up with:
var thrust; //between 1 & 100 how much the engines are pushing
var ...
0
votes
3answers
363 views
Can these game be fully coded in html5/javascript?
I mean the mechanics of the game. Would it be possible?
-Pokemon GBA series, rendering the world would be easy, but what about battle mechanics?
-MapleStory, after seen dragonbound.net which is an ...
-1
votes
1answer
141 views
Interacting with box2D objects
How can I interact with an object in box2d, I'm completely new to this so I have no clue what to do. The box is created like this:
bodyDef.type = b2Body.b2_dynamicBody;
fixDef.shape = new ...
-1
votes
0answers
64 views
ball 2d animation [duplicate]
Possible Duplicate:
canvas ball physics animation
I want to animate ball in html canvas like this.
ctx.beginPath();
ctx.arc(75, 75, 10, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
...