From 9db61826aa300b65fdf079c95bcc660dfdb738d5 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Sun, 24 Jul 2016 21:40:12 +1200 Subject: [PATCH] - Sticky tiles no longer make you unable to walk left. - Make PW_PILL work for both players, not just player 1. - Slightly increase base player speed. --- defs.h | 3 +++ rc.c | 37 ++++++++++++++++++++++--------------- shared.c | 7 +++---- todo | 17 +++++++++++++---- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/defs.h b/defs.h index cff6774..560e0c3 100644 --- a/defs.h +++ b/defs.h @@ -201,6 +201,9 @@ enum ENDGAMETYPE { #define POWERUPTIME 15 // # secs before a powerup appears #define POWERUPTIME2 10 // # secs before a powerup appears +#define DEFAULTSPEED 1 + +#define PLAYERSLOW 1.2 // how fast player goes initially #define PLAYERFAST 2 // how fast player goes with speed powerup #define PLAYERPILL 4 // how fast player goes with pill powerup diff --git a/rc.c b/rc.c index 5fbb1bb..225653f 100644 --- a/rc.c +++ b/rc.c @@ -1834,10 +1834,13 @@ void nextlevel(void) { if (cheat) { if (player) { - player->speed = 2; + player->speed = PLAYERFAST; player->netmax = 4; } - if (player2) player2->speed = 2; + if (player2) { + player2->speed = PLAYERFAST; + player2->netmax = 4; + } } @@ -1969,10 +1972,10 @@ void jump(sprite_t *s, int dir) { // jetpack always adds speed to sideways jumps if (s->jumpdir > 0) { s->jumpdir++; - if (!haspowerup(s, P_SPEED) == 1) s->jumpdir++; // go fast even if player is slow + if (!haspowerup(s, P_SPEED) == PLAYERSLOW) s->jumpdir++; // go fast even if player is slow } else if (s->jumpdir < 0) { s->jumpdir--; - if (!haspowerup(s, P_SPEED) == 1) s->jumpdir--; // go fast even if player is slow + if (!haspowerup(s, P_SPEED) == PLAYERSLOW) s->jumpdir--; // go fast even if player is slow } } else { tt= gettileat(s->x, s->y, NULL, NULL); @@ -7265,16 +7268,14 @@ void drawlevel(void) { double getspeed(sprite_t *s ) { int id = s->id; - double speed = 1; + double speed = DEFAULTSPEED; - if (s == player) { + if ((s == player) || (s == player2)) { if (haspowerup(s, PW_PILL)) { speed = PLAYERPILL; } else { speed = s->speed; } - } else if (s == player2) { - speed = s->speed; } else if (id == P_SNAIL) { if (s->recoiling) { speed = 2; @@ -9226,7 +9227,13 @@ int movex(sprite_t *s,double amt,int onpurpose) { if (tt->sticky && onpurpose && !s->falling) { amt /= 2; // enforce minimum speed for player - if (isplayer(s) && amt < 1) amt = 1; + if (isplayer(s)) { + if (amt > 0 && amt < 1) { + amt = 1; + } else if (amt < 0 && amt > -1) { + amt = -1; + } + } } } @@ -9537,7 +9544,7 @@ int dofruiteffect(sprite_t *pp, sprite_t *s) { playfx(FX_POWERUP); pp->netmax = 4; // all nets pp->netbig = B_TRUE; // big net - pp->speed = 2; // fast + pp->speed = PLAYERFAST; // fast sprintf(tempm, "Full power!"); addoutlinetext(s->x,s->y - s->img->h/2, TEXTSIZE_POINTS, tempm,&white,&black,POINTSDELAY, TT_NORM); return B_TRUE; @@ -11343,7 +11350,7 @@ int haspowerup(sprite_t *s, int pid) { if (!s) return B_FALSE; switch (pid) { case P_SPEED: - if (s->speed != 1) { + if (s->speed != PLAYERSLOW) { return B_TRUE; } break; @@ -11363,7 +11370,7 @@ int haspowerup(sprite_t *s, int pid) { } break; case P_TROPHY: - if ((s->netmax >= 4) && (s->netbig) && (s->speed != 1)) { + if ((s->netmax >= 4) && (s->netbig) && (s->speed != PLAYERSLOW)) { return B_TRUE; } break; @@ -11942,7 +11949,7 @@ void dopokereffect(sprite_t *pl, int effect) { pl->permspeed = B_TRUE; pl->permbignet = B_TRUE; pl->permnumnets = 4; - pl->speed = 2; + pl->speed = PLAYERFAST; pl->netbig = B_TRUE; pl->netmax = 4; sprintf(tempmsg, "Permenant full power!"); @@ -12151,7 +12158,7 @@ if (cheat) { player->powerup = PW_RAYGUN; player->netmax = 4; // all nets player->netbig = B_TRUE; // big net - player->speed = 2; // fast + player->speed = PLAYERFAST; // fast player->netsticky = B_TRUE; player->doublejump = B_TRUE; player->hasbell = B_TRUE; @@ -12164,7 +12171,7 @@ if (cheat) { if (player2) { player2->netmax = 4; // all nets player2->netbig = B_TRUE; // big net - player2->speed = 2; // fast + player2->speed = PLAYERFAST; // fast player2->netsticky = B_TRUE; player2->doublejump = B_TRUE; player2->hasbell = B_TRUE; diff --git a/shared.c b/shared.c index 183f8b6..6bc411a 100644 --- a/shared.c +++ b/shared.c @@ -817,9 +817,9 @@ void setdefaults(sprite_t *s) { // player powerup stats if (s->permspeed) { - s->speed = 2; + s->speed = PLAYERFAST; } else { - s->speed = 1; + s->speed = PLAYERSLOW; } if (s->permbignet) { s->netbig = B_TRUE; @@ -871,7 +871,7 @@ void setdefaults(sprite_t *s) { if (s->id == P_PLATFORM) { s->speed = PLATFORM_MAXSPEED; } else { - s->speed = 1; + s->speed = DEFAULTSPEED; } s->hasmask = B_FALSE; @@ -885,7 +885,6 @@ void setdefaults(sprite_t *s) { s->doublejumpready = B_FALSE; - s->allocimg = B_FALSE; s->frame = 0; diff --git a/todo b/todo index de3b164..db60a0b 100644 --- a/todo +++ b/todo @@ -1,11 +1,18 @@ +*- Walking lfet on sticky tiles makes you walk right!! +*- make pill work for player2 +*- slightly increase base player speed + - make points worth chasing for something more than a high schore - bonus level teleport appears on next level once you reach a certain amount of points ? + + Figure out POINT VALUES? + 1-13 - 233k - - ability to spent points on something in a shop? - - - bonus levels or shop gives: - permenant special power ? + - bonus levels: + ..triple walk speed? + ..spike boots to jump on monsters + ..50% chance to skip two levels each time? - Make level editor work again in opengl @@ -13,6 +20,8 @@ - top left tile is always blank?? +make base walk speed _slightly_ faster? + - New powerups: - until end of level - [ ] treasure map- chest falls at end of level and shoots