shithub: musw

Download patch

ref: 0f75049222798e1bfee7c5bff80bee6a0b7fdd2c
parent: 5052a27ece26976e3bec769896bbdc65d9e5ede2
author: rodri <[email protected]>
date: Thu Feb 23 15:15:05 EST 2023

made adjustments to the particles's thrust and player input processing.

--- a/dat.h
+++ b/dat.h
@@ -52,7 +52,7 @@
 };
 
 enum {
-	THRUST = 100
+	THRUST = 10
 };
 
 typedef struct VModel VModel;
--- a/muswd.c
+++ b/muswd.c
@@ -214,7 +214,6 @@
 				if(debug)
 					fprint(2, "\t%.*lub\n", sizeof(kdown)*8, kdown);
 
-				nc->player->oldkdown = nc->player->kdown;
 				nc->player->kdown = kdown;
 
 				break;
@@ -318,13 +317,13 @@
 	io = ioproc();
 
 	for(;;){
-		if(players.len >= 2)
-			newparty(&theparty, players.get(&players), players.get(&players));
-
 		now = nanosec();
 		frametime = now - then;
 		then = now;
 
+		if(players.len >= 2)
+			newparty(&theparty, players.get(&players), players.get(&players));
+
 partywalk:
 		for(p = theparty.next; p != &theparty; p = p->next){
 			p->u->timeacc += frametime/1e9;
@@ -345,8 +344,11 @@
 					ship->rotate(ship, -1, Δt);
 				if((player->kdown & 1<<Khyper) != 0)
 					ship->hyperjump(ship);
-				if((player->kdown & 1<<Kfire) != 0)
+				if(player->oldkdown != player->kdown &&
+				   (player->kdown & 1<<Kfire) != 0)
 					ship->fire(ship);
+
+				player->oldkdown = player->kdown;
 			}
 
 			while(p->u->timeacc >= Δt)
--- a/universe.c
+++ b/universe.c
@@ -48,7 +48,7 @@
 		0, 0, 1,
 	};
 
-	bv = mulpt2(xform(Vec2(1,0), R), THRUST);
+	bv = mulpt2(xform(Vec2(1,0), R), 10*THRUST);
 
 	for(i = 0; i < nelem(s->rounds); i++)
 		if(!s->rounds[i].fired){