Solve Physics Problems in Your Homebrew Video Game with These Tips!

  • Context: Undergrad 
  • Thread starter Thread starter Gohtar
  • Start date Start date
  • Tags Tags
    Force
Click For Summary
SUMMARY

The discussion focuses on implementing physics for a homebrew video game involving three objects with equal mass and velocity. The user aims to achieve a system where, upon collision, the third object transfers its momentum to the second object, resulting in all three objects moving in the same direction. The key concept discussed is the conservation of linear momentum, particularly in the context of inelastic collisions, where objects do not bounce apart but rather move together post-collision. The user is specifically working within a 2D plane and is not considering friction in their calculations.

PREREQUISITES
  • Understanding of linear momentum and its conservation principles
  • Familiarity with 2D physics simulations
  • Basic knowledge of inelastic collisions
  • Experience with programming physics in game development
NEXT STEPS
  • Research "Conservation of Momentum in Inelastic Collisions" for detailed calculations
  • Explore physics libraries like Box2D for implementing collision mechanics
  • Learn about 2D physics engines and their handling of object interactions
  • Investigate methods for calculating resultant velocities after collisions in game physics
USEFUL FOR

Game developers, physics programmers, and hobbyists creating homebrew video games who need to implement realistic or simplified physics interactions among game objects.

Gohtar
Messages
2
Reaction score
0
I have been racking my brains for 2 days.

I am working on a homebrew video game and am having problems with the physics.

say i have 3 objects, one moving left to right(1) the other 2 moving right to left(2,3).

they all have the same mass and velocity.

Say the mass is 100 units and the velocity is 1 unit.

So far i have been able to get the code to work where if object1 collides with object2 then they both stop moving. What I want to happen is if object3 collides with the back of object2 that it will transfer it's force to both objects and I will get movement in all 3 in the right to left direction.

Friction is zero, not a factor in this.

I think what I am mostly stuck on now is how to calculate the velocity of the group of objects when that 3rd one starts pushing.

Thanks

EDIT

forgot to mention, right now i am only dealing in a 2d plane with the forces only being applied in the X axis.
 
Last edited:
Physics news on Phys.org
Gohtar said:
I have been racking my brains for 2 days.

I am working on a homebrew video game and am having problems with the physics.

say i have 3 objects, one moving left to right(1) the other 2 moving right to left(2,3).

they all have the same mass and velocity.

Say the mass is 100 units and the velocity is 1 unit.

So far i have been able to get the code to work where if object1 collides with object2 then they both stop moving. What I want to happen is if object3 collides with the back of object2 that it will transfer it's force to both objects and I will get movement in all 3 in the right to left direction.

Friction is zero, not a factor in this.

I think what I am mostly stuck on now is how to calculate the velocity of the group of objects when that 3rd one starts pushing.

Thanks

EDIT

forgot to mention, right now i am only dealing in a 2d plane with the forces only being applied in the X axis.

Welcome to the PF. Sounds like you are modelling elastic collisions. Think "conservation of linear momentum"

http://en.wikipedia.org/wiki/Momentum#Elastic_collisions

Why would two objects stop moving if they collide? Wouldn't they bounce back apart?
 
berkeman said:
Welcome to the PF. Sounds like you are modelling elastic collisions. Think "conservation of linear momentum"

http://en.wikipedia.org/wiki/Momentum#Elastic_collisions

Why would two objects stop moving if they collide? Wouldn't they bounce back apart?

No i am thinking more bulldozer type collisions, it hits the other object and starts moving it if it can, no bounce. I am not going for realism at all here.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K