From 4fe780c1e888342acecfdadf629d6d50235825c9 Mon Sep 17 00:00:00 2001 From: Barry Kane Date: Tue, 21 Mar 2023 13:35:07 +0000 Subject: [PATCH] Added basic "wormhole" behaviour Going into the star transports you to random coordinates in the world. --- spacewarPlayer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacewarPlayer.h b/spacewarPlayer.h index 388bf36..76828b1 100644 --- a/spacewarPlayer.h +++ b/spacewarPlayer.h @@ -42,7 +42,8 @@ static inline void calculateGravity(xyVector * starPosition, ship * shipUnderGra } else { - gravityAcceleration = 1; + shipUnderGravity->position.xComponent = random() % 4000; + shipUnderGravity->position.yComponent = random() % 4000; } } else