v0.0.6
Spacewalk Prototype » Devlog
For the first time being able to work on this project in a while, I decided to get started on adding debris and collisions. For the time being, there is one asteroid that appears directly above the player and has the same mass as the player. Run and do nothing to watch them collide!
For the physics, I did a few things:
- Scratch my head, trying to reason out the conservation of momentum based equations from the particle physics I'm already doing, but without actually doing any thinking
- Googled it, using the equations from https://www.easycalculation.com/physics/classical-physics/learn-elastic-collisio...
- These equations are valid for a collision where one object starts at rest. To apply them, I first shift into the reference frame of one of the actors in the collision, using v1 = actorA.velocity - actorB.velocity, and then convert back into the screen reference frame at the end by adding the original actorB.velocity to both actors.
- To adapt the equations to 2D collisions, I simply did each calculation looking at only the x and only the y dimension, and converted the results to vectors. I had to do it that way because my vector math functions don't currently support multiplying a vector by a scalar.
Next steps:
- Clean up the code! I've got a lot of messy code from the early stages and things that need to be refactored to make further development easier.
- Add random asteroids and anthropogenic debris passing by
- Add a goal!
- Detached antenna that needs to be pushed back into place, to start
- Maybe even make an "animated" intro using simulated physics, by having an asteroid collide with the antenna?!
Files
spacewalk_prototype_v0.0.6.zip Play in browser
Feb 18, 2021
Spacewalk Prototype
Prototype for conservation of momentum based spacewalk sim
Status | Prototype |
Author | discoPiranha |
More posts
- v0.0.5Jan 25, 2021
- v0.0.4Jan 21, 2021
- Version 0.0.2 - This time you can tell what it's doingJan 11, 2021
Leave a comment
Log in with itch.io to leave a comment.