- More tweaks to ladder behaviour wrt getting on/off
- Appended 'fps' to score/fps display when pressing f2
This commit is contained in:
parent
6d42aa287a
commit
c5890190ea
40
rc.c
40
rc.c
|
@ -1725,10 +1725,8 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
bouncesprite(s);
|
||||
|
||||
if ((s->ys >= 0) && (s->y >= TILEH)) {
|
||||
if (s->quickdie || isonground(s)) {
|
||||
int x,y,ty;
|
||||
s->dead = D_FINAL;
|
||||
/* change into a fruit */
|
||||
// get position for puff/fruit
|
||||
x = s->x;
|
||||
gettileat(s->x,s->y-1,NULL,&ty);
|
||||
//y = ty*TILEH + TILEH - 2;
|
||||
|
@ -1738,11 +1736,18 @@ if (s->id == P_PUFF) printf("PUFF WITH DOOMCOUNT!\n");
|
|||
if (x > (640-TILEW)) x = 640-TILEW;
|
||||
if (x < (TILEW)) x = TILEW;
|
||||
|
||||
if (s->quickdie || (isonground(s) && !isongroundpoint(s, s->x, s->y-TILEH))) {
|
||||
/* change into a fruit */
|
||||
s->dead = D_FINAL;
|
||||
//addsprite(s->willbecome, x, y, "Fruit", B_FALSE);
|
||||
puffin(s->willbecome, x, y, "fruit", 0);
|
||||
//ss = addsprite(P_PUFF, x, y, "Fruit", B_FALSE);
|
||||
//ss->timer3 = s->willbecome;
|
||||
|
||||
} else if (s->bounces >= 6) {
|
||||
// just die
|
||||
s->dead = D_FINAL;
|
||||
puffin(-1, x, y, "nothing_sprd", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3764,11 +3769,12 @@ void drawscore(void) {
|
|||
|
||||
if (wantframerate) {
|
||||
scoreval = fps;
|
||||
sprintf(tempm, "%d fps",scoreval);
|
||||
} else {
|
||||
scoreval = player->score;
|
||||
addcommas(tempm, scoreval);
|
||||
}
|
||||
|
||||
addcommas(tempm, scoreval);
|
||||
|
||||
/* shadow */
|
||||
score = TTF_RenderText_Solid(font[TEXTSIZE_SCORE], tempm, black);
|
||||
|
@ -4212,6 +4218,7 @@ int isladder(int tid) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// return the x position of the middle of the ladder if so
|
||||
int isonladder(sprite_t *s) {
|
||||
int tx;
|
||||
|
@ -5563,7 +5570,6 @@ void usage(void) {
|
|||
int canmove(sprite_t *pl) {
|
||||
if (!pl->jumping && !pl->slamming ) {
|
||||
if (!pl->netting) {
|
||||
//if (!isonladder(pl) || pl->falling || isonground(pl)) {
|
||||
if ( pl->climbing || pl->falling || isonground(pl)) {
|
||||
return B_TRUE;
|
||||
}
|
||||
|
@ -7212,7 +7218,21 @@ if (cheat) {
|
|||
************************************************************/
|
||||
if ((!paused) && (!levelcomplete != LV_DOPOKER) && (levelcomplete != LV_CLOUDLOOP)) {
|
||||
if ((!player->dead) && (!player->teleporting)) {
|
||||
if (!player->climbing) {
|
||||
int moveok = B_FALSE;
|
||||
if (player->climbing) {
|
||||
tiletype_t *tt;
|
||||
// can only move left/right if we're at the bottom of a ladder
|
||||
tt = gettileat(player->x,player->y, NULL,NULL);
|
||||
if (tt->solid) {
|
||||
moveok = B_TRUE;
|
||||
}
|
||||
tt = gettileat(player->x,player->y+TILEH, NULL,NULL);
|
||||
if (tt->solid ) {
|
||||
moveok = B_TRUE;
|
||||
}
|
||||
} else moveok = B_TRUE;
|
||||
|
||||
if (moveok) {
|
||||
if (keydown(SDLK_RIGHT)) {
|
||||
if (canmove(player)) {
|
||||
movex(player, getspeed(player));
|
||||
|
@ -7229,11 +7249,17 @@ if (cheat) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (keydown(SDLK_UP)) {
|
||||
if (!player->netting && !player->slamming && !player->jumping) {
|
||||
if (player->climbing) {
|
||||
int ladderx = isladderabove(player);
|
||||
// if tile above is non-solid, or a ladder
|
||||
if (isladderabove(player) || !isroofabove(player)) {
|
||||
if (ladderx || !isroofabove(player)) {
|
||||
// lock to ladder
|
||||
if (ladderx) {
|
||||
player->x = ladderx; // lock to ladder
|
||||
}
|
||||
// continue climbing
|
||||
player->y -= getspeed(player);
|
||||
player->jumping = 0;
|
||||
|
|
Loading…
Reference in New Issue