aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-02-23 20:15:05 +0000
committerrodri <rgl@antares-labs.eu>2023-02-23 20:15:05 +0000
commit0f75049222798e1bfee7c5bff80bee6a0b7fdd2c (patch)
tree3ad66af278fa88d0286231bee8b20749146d7664
parent5052a27ece26976e3bec769896bbdc65d9e5ede2 (diff)
downloadmusw-0f75049222798e1bfee7c5bff80bee6a0b7fdd2c.tar.gz
musw-0f75049222798e1bfee7c5bff80bee6a0b7fdd2c.tar.bz2
musw-0f75049222798e1bfee7c5bff80bee6a0b7fdd2c.zip
made adjustments to the particles's thrust and player input processing.
-rw-r--r--dat.h2
-rw-r--r--muswd.c12
-rw-r--r--universe.c2
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<<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)
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){