diff --git a/defs.h b/defs.h index 4dda1ec..db6f0df 100644 --- a/defs.h +++ b/defs.h @@ -6,12 +6,13 @@ /* Macros */ //#define OPENGL -// channel numbers +// sound channel numbers #define CH_LASTCHANNEL 21 - #define CH_HURRYUP 20 + + // size of flower straem when getting last flower // (number of gems on each side) #define STREAMWID 6 @@ -39,6 +40,10 @@ #define HELPDELAY 80 +// +#define POWERUPTIME 15 // # secs before a powerup appears + + // Sizes #define TILEH 16 // tile width (in pixels) #define TILEW 16 // tile height (in pixels) diff --git a/rc b/rc index eae496d..d7997df 100755 Binary files a/rc and b/rc differ diff --git a/rc.c b/rc.c index 62654a6..12871c0 100644 --- a/rc.c +++ b/rc.c @@ -865,7 +865,6 @@ void movesprite(sprite_t *s) { if (s->caughtby) { if (s->caughtby->slamming) { - /* */ s->x = s->caughtby->netxstart; @@ -2341,8 +2340,20 @@ void dogravity(sprite_t *s) { } if (s->slamming) { + int netx; + double dist; + int hitwall = B_FALSE; + s->slamangle += (10 * (M_PI/180)); - if (s->slamangle >= (180 * (M_PI/180))) { + + + dist = (s->slamangle * (180/M_PI))/2; + netx = s->x + cos(s->slamangle-(180*(M_PI/180)))*dist*s->dir; + if ((netx >= (640-TILEW)) || (netx <= TILEW)) { + hitwall = B_TRUE; + } + + if (s->slamangle >= (180 * (M_PI/180)) || hitwall) { /* finished slamming */ int xdiff,ydiff,xnet = 0,ynet = 0; int pointsinc = 250; @@ -2360,8 +2371,8 @@ void dogravity(sprite_t *s) { if (s2->caughtby == s) { tiletype_t *tt; tt = gettileat(s2->x,s2->y+2,NULL,NULL); - /* if on ground, monster dies */ - if ((tt == NULL) || (tt->solid)) { + /* if on ground or hitting a wall, monster dies */ + if ((hitwall) || (tt == NULL) || (tt->solid)) { /* will become a fruit when it finishes dying */ s2->willbecome = fruittypes[curfruittype]; /* increment fruit type */ diff --git a/shared.c b/shared.c index 6f8f975..85fb06a 100644 --- a/shared.c +++ b/shared.c @@ -66,7 +66,7 @@ int loadlevel(int wnum, int lnum) { /* default */ level->hurryuptime = 30; - level->poweruptime = 5; + level->poweruptime = POWERUPTIME; level->p1x = 0; level->p1y = 0; level->powerupx = -1;