Fixed bug with slamming a monster off the side of the screen
This commit is contained in:
parent
f490e145f4
commit
f1962993b2
9
defs.h
9
defs.h
|
@ -6,12 +6,13 @@
|
||||||
/* Macros */
|
/* Macros */
|
||||||
//#define OPENGL
|
//#define OPENGL
|
||||||
|
|
||||||
// channel numbers
|
// sound channel numbers
|
||||||
#define CH_LASTCHANNEL 21
|
#define CH_LASTCHANNEL 21
|
||||||
|
|
||||||
#define CH_HURRYUP 20
|
#define CH_HURRYUP 20
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// size of flower straem when getting last flower
|
// size of flower straem when getting last flower
|
||||||
// (number of gems on each side)
|
// (number of gems on each side)
|
||||||
#define STREAMWID 6
|
#define STREAMWID 6
|
||||||
|
@ -39,6 +40,10 @@
|
||||||
#define HELPDELAY 80
|
#define HELPDELAY 80
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
#define POWERUPTIME 15 // # secs before a powerup appears
|
||||||
|
|
||||||
|
|
||||||
// Sizes
|
// Sizes
|
||||||
#define TILEH 16 // tile width (in pixels)
|
#define TILEH 16 // tile width (in pixels)
|
||||||
#define TILEW 16 // tile height (in pixels)
|
#define TILEW 16 // tile height (in pixels)
|
||||||
|
|
19
rc.c
19
rc.c
|
@ -865,7 +865,6 @@ void movesprite(sprite_t *s) {
|
||||||
|
|
||||||
if (s->caughtby) {
|
if (s->caughtby) {
|
||||||
if (s->caughtby->slamming) {
|
if (s->caughtby->slamming) {
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
s->x = s->caughtby->netxstart;
|
s->x = s->caughtby->netxstart;
|
||||||
|
@ -2341,8 +2340,20 @@ void dogravity(sprite_t *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->slamming) {
|
if (s->slamming) {
|
||||||
|
int netx;
|
||||||
|
double dist;
|
||||||
|
int hitwall = B_FALSE;
|
||||||
|
|
||||||
s->slamangle += (10 * (M_PI/180));
|
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 */
|
/* finished slamming */
|
||||||
int xdiff,ydiff,xnet = 0,ynet = 0;
|
int xdiff,ydiff,xnet = 0,ynet = 0;
|
||||||
int pointsinc = 250;
|
int pointsinc = 250;
|
||||||
|
@ -2360,8 +2371,8 @@ void dogravity(sprite_t *s) {
|
||||||
if (s2->caughtby == s) {
|
if (s2->caughtby == s) {
|
||||||
tiletype_t *tt;
|
tiletype_t *tt;
|
||||||
tt = gettileat(s2->x,s2->y+2,NULL,NULL);
|
tt = gettileat(s2->x,s2->y+2,NULL,NULL);
|
||||||
/* if on ground, monster dies */
|
/* if on ground or hitting a wall, monster dies */
|
||||||
if ((tt == NULL) || (tt->solid)) {
|
if ((hitwall) || (tt == NULL) || (tt->solid)) {
|
||||||
/* will become a fruit when it finishes dying */
|
/* will become a fruit when it finishes dying */
|
||||||
s2->willbecome = fruittypes[curfruittype];
|
s2->willbecome = fruittypes[curfruittype];
|
||||||
/* increment fruit type */
|
/* increment fruit type */
|
||||||
|
|
2
shared.c
2
shared.c
|
@ -66,7 +66,7 @@ int loadlevel(int wnum, int lnum) {
|
||||||
|
|
||||||
/* default */
|
/* default */
|
||||||
level->hurryuptime = 30;
|
level->hurryuptime = 30;
|
||||||
level->poweruptime = 5;
|
level->poweruptime = POWERUPTIME;
|
||||||
level->p1x = 0;
|
level->p1x = 0;
|
||||||
level->p1y = 0;
|
level->p1y = 0;
|
||||||
level->powerupx = -1;
|
level->powerupx = -1;
|
||||||
|
|
Loading…
Reference in New Issue