From 0f75049222798e1bfee7c5bff80bee6a0b7fdd2c Mon Sep 17 00:00:00 2001 From: rodri Date: Thu, 23 Feb 2023 20:15:05 +0000 Subject: made adjustments to the particles's thrust and player input processing. --- dat.h | 2 +- muswd.c | 12 +++++++----- universe.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dat.h b/dat.h index 5e984bb..26755c5 100644 --- a/dat.h +++ b/dat.h @@ -52,7 +52,7 @@ enum { }; enum { - THRUST = 100 + THRUST = 10 }; typedef struct VModel VModel; diff --git a/muswd.c b/muswd.c index ccaae27..7624a7f 100644 --- a/muswd.c +++ b/muswd.c @@ -214,7 +214,6 @@ threadnetppu(void *) 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 @@ threadsim(void *) 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 @@ partywalk: ship->rotate(ship, -1, Δt); if((player->kdown & 1<hyperjump(ship); - if((player->kdown & 1<oldkdown != player->kdown && + (player->kdown & 1<fire(ship); + + player->oldkdown = player->kdown; } while(p->u->timeacc >= Δt) diff --git a/universe.c b/universe.c index bce345c..cf310ef 100644 --- a/universe.c +++ b/universe.c @@ -48,7 +48,7 @@ ship_fire(Ship *s) 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){ -- cgit v1.2.3