POC
Spacewar! » Devlog
At this point this is only a proof-of-concept for the physics and wrap around nature of the world. Maybe it’s kinda fun if you like littering the solar system with spent torpedo casings? (I realize that’s not actually the design intent, but I might incorporate something like this since I do kinda like it!)
A few interesting learnings so far:
- I slammed my head against planet-as-body and planet-as-gravity before realizing that these are actually two different things. Thus:
- I managed to slap together the basics of rotational thrust before seeing this bit of documentation and realizing I was fighting the system.
- Wrap around logic was surprisingly straightforward:
# wrapper.gd
func _on_body_entered(body):
if body.has_method("set_translation"):
body.set_translation(translation)
# anything-that-needs-to-wrap.gd
func _integrate_forces(state):
if translation != Vector2.ZERO:
state.transform = Transform2D(transform.get_rotation(), transform.get_origin() + translation)
translation = Vector2.ZERO
My next major milestone will be making this an actual game: adding other ships, collisions, and scoring.
Files
spacewar-web.zip Play in browser
Version c6e2b0bf Nov 25, 2023
spacewar-web.zip Play in browser
Version 6ba68bd4 Nov 12, 2023
Leave a comment
Log in with itch.io to leave a comment.