Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by szimek

Hi,

I'd like to create a game game where players run around a small planet (the whole planet/circle is visible on the screen and the center of gravity is at the center of the planet), shoot etc. Is it possible to do it with ImpactJS?

If running, jumping and shooting around a circle with gravity etc. is not possible, maybe it would be possible to make it differently - the whole game logic could work in Cartesian coordinate system, where players move on a single plane (with the only trick that if an entity leaves the screen on the right, it reappears on the left and vice versa) and then after all input/physics position updates are processed, it would simply draw them using polar coordinates - one can think of it as if the plane on which the players move was folded to form a circle. I'm not sure if it's actually an easier solution :)

Cheers,
Szymon

1 decade ago by Pat

I'm wondering the same. I'm just trying to figure out if it's possible to build a pong game with Impact, but with a curved paddle? Is it possible to do that with Impact?

1 decade ago by Pat

Is this forum still active?

1 decade ago by Joncom

Quote from Pat
I'm wondering the same. I'm just trying to figure out if it's possible to build a pong game with Impact, but with a curved paddle? Is it possible to do that with Impact?
Sure, it's possible. Use Box2D. Here's an introduction. And I'd recommend you use this plugin instead of the official one because it's easier to work with and has many improvements. The plugin also includes a "capsule" entity you could extend for your puck, which is shaped something like this:

/><br />
<blockquote><em>Quote from szimek</em><br />
I'd like to create a game game where players run around a small planet (the whole planet/circle is visible on the screen and the center of gravity is at the center of the planet), shoot etc. Is it possible to do it with ImpactJS?</blockquote>Yes, the game goes for you. Use Box2D. However, instead of using regular gravity, apply gravity individually to each entity by applying a force (and use the center point of the planet as the vector).			</div>
		</div>
			<div class=

1 decade ago by szimek

@Joncom - Thanks!

One more question - to make players move around the circle, should I set direction of their velocity vectors as a tangent of the circle? I guess they'll already have another velocity vector due to gravity, so to calculate the final vector, do I simply sum these 2 vectors?

1 decade ago by Joncom

Just apply the gravity as one step. And then apply the walk-motion as another step. Box2D will handle any summation that needs to occur. And yes, I believe your direction of "travelling around the globe" will always be a tangent line to the circle-surface.

1 decade ago by szimek

@Joncom Thanks a lot!

I've been playing with Box2D yesterday a bit and while I got basic gravity working it looks like it's going to take a lot of time to make everything work properly - e.g. fix player's y axis to always point away from the center of the planet, so that they don't fall down; limit maximum speed, so that you can't run off into an orbit etc.

Here's what I've got currently:

/><br />
<br />
:)<br />
<br />
I'll try to make a fake version where everything happens on a horizontal platform and then is rendered using polar coordinates to make it look "round" - maybe it's going to be easier.			</div>
		</div>
	
	
<div class= Page 1 of 1
« first « previous next › last »