diff options
-rw-r--r-- | dat.h | 2 | ||||
-rw-r--r-- | muswd.c | 12 | ||||
-rw-r--r-- | universe.c | 2 |
3 files changed, 9 insertions, 7 deletions
@@ -52,7 +52,7 @@ enum { }; enum { - THRUST = 100 + THRUST = 10 }; typedef struct VModel VModel; @@ -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<<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) @@ -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){ |