- Added animation for slamming
7
defs.h
|
@ -59,7 +59,7 @@
|
|||
#define MAXMAPPINGS 50
|
||||
#define MAXMONSTERSPERLEVEL 40
|
||||
#define MAXLETTERHEIGHT 100
|
||||
#define MAXFRAMES 11 // max number of frames for sprites
|
||||
#define MAXFRAMES 16 // max number of frames for sprites
|
||||
#define MAXHELP 5
|
||||
#define MAXTILEFRAMES 10 // max number of frames for animated tiles
|
||||
|
||||
|
@ -137,6 +137,11 @@
|
|||
#define F_CLIMB1 8
|
||||
#define F_CLIMB2 9
|
||||
#define F_SHOOT 10
|
||||
#define F_SLAM1 11
|
||||
#define F_SLAM2 12
|
||||
#define F_SLAM3 13
|
||||
#define F_SLAM4 14
|
||||
#define F_SLAM5 15
|
||||
|
||||
// Tile types
|
||||
#define T_BLANK 0
|
||||
|
|
13
rc.c
|
@ -772,7 +772,6 @@ void movesprite(sprite_t *s) {
|
|||
tiletype_t *tt;
|
||||
tt = gettileat(s->x,s->y,&tx,&ty);
|
||||
|
||||
printf("finished bouncing, sprite is at: %d, %d (tileid %d)\n",tx,ty,tt->id);
|
||||
s->dead = D_LASTBOUNCE;
|
||||
}
|
||||
}
|
||||
|
@ -2267,18 +2266,6 @@ int dofruiteffect(sprite_t *s) {
|
|||
return B_FALSE;
|
||||
}
|
||||
|
||||
int ismonster(int id) {
|
||||
if (id == P_RAT) return B_TRUE;
|
||||
if (id == P_BEE) return B_TRUE;
|
||||
if (id == P_SPIDER) return B_TRUE;
|
||||
if (id == P_SNAKE) return B_TRUE;
|
||||
if (id == P_CLOUD) return B_TRUE;
|
||||
if (id == P_COKE) return B_TRUE;
|
||||
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
|
||||
void usage(void) {
|
||||
printf("usage: rc [-fs] [-l xx]\n");
|
||||
printf(" -fs Start in full-screen mode.\n");
|
||||
|
|
1
rc.h
|
@ -24,7 +24,6 @@ int isonladder(sprite_t *s);
|
|||
int isonbridge(sprite_t *s);
|
||||
int isladderabove(sprite_t *s);
|
||||
int dofruiteffect(sprite_t *s);
|
||||
int ismonster(int id);
|
||||
void checkcollide(sprite_t *s);
|
||||
void die(sprite_t *s);
|
||||
void nextlevel(void);
|
||||
|
|
37
shared.c
|
@ -40,6 +40,8 @@ int loadlevel(int wnum, int lnum) {
|
|||
int numanim = 0;
|
||||
int tempanim[LEVELW*LEVELH];
|
||||
|
||||
int numenemies = 0;
|
||||
|
||||
|
||||
printf("Loading level %d-%d...",wnum,lnum);
|
||||
|
||||
|
@ -231,6 +233,8 @@ int loadlevel(int wnum, int lnum) {
|
|||
level->initm[level->nummonsters].starty = y*TILEH+(TILEH-2)+2;
|
||||
level->initm[level->nummonsters].id = monid;
|
||||
|
||||
if (ismonster(monid)) numenemies++;
|
||||
|
||||
if (monid == P_HELP) {
|
||||
if (curhelp >= numhelp) {
|
||||
printf("Error in level - more help icons than help texts.\n");
|
||||
|
@ -252,6 +256,8 @@ int loadlevel(int wnum, int lnum) {
|
|||
fgets(buf, BUFLEN, f);
|
||||
}
|
||||
|
||||
printf("got %d monsters\n", numenemies);
|
||||
|
||||
/* check whether we've got a new or old level version */
|
||||
if (strstr(buf, ",")) {
|
||||
/* new version */
|
||||
|
@ -873,7 +879,12 @@ int loadimagesets(void) {
|
|||
loadspriteimage(P_PLAYER,F_CLIMB1, "sprites/dclimb1.png");
|
||||
loadspriteimage(P_PLAYER,F_CLIMB2, "sprites/dclimb2.png");
|
||||
loadspriteimage(P_PLAYER,F_SHOOT, "sprites/dwarfshoot.png");
|
||||
imageset[P_PLAYER].numimages = 11;
|
||||
loadspriteimage(P_PLAYER,F_SLAM1, "sprites/dslam1.png");
|
||||
loadspriteimage(P_PLAYER,F_SLAM2, "sprites/dslam2.png");
|
||||
loadspriteimage(P_PLAYER,F_SLAM3, "sprites/dslam3.png");
|
||||
loadspriteimage(P_PLAYER,F_SLAM4, "sprites/dslam4.png");
|
||||
loadspriteimage(P_PLAYER,F_SLAM5, "sprites/dslam5.png");
|
||||
imageset[P_PLAYER].numimages = 16;
|
||||
|
||||
loadspriteimage(P_SNAKE,F_WALK1, "sprites/snake.bmp");
|
||||
loadspriteimage(P_SNAKE,F_JUMP, "sprites/snakejump.bmp");
|
||||
|
@ -1099,6 +1110,19 @@ void drawsprite(sprite_t *s) {
|
|||
frame = F_JUMP;
|
||||
} else if (s->falling) {
|
||||
frame = F_FALL;
|
||||
} else if (s->slamming) {
|
||||
double slamdegs = s->slamangle / (M_PI/180);
|
||||
if (slamdegs < 36) {
|
||||
frame = F_SLAM1;
|
||||
} else if (slamdegs < 72) {
|
||||
frame = F_SLAM2;
|
||||
} else if (slamdegs < 108) {
|
||||
frame = F_SLAM3;
|
||||
} else if (slamdegs < 144) {
|
||||
frame = F_SLAM4;
|
||||
} else {
|
||||
frame = F_SLAM5;
|
||||
}
|
||||
} else if (!s->teleporting) {
|
||||
if ((s->id == P_SPIDER) && (s->ys != -99)) {
|
||||
frame = F_FALL;
|
||||
|
@ -1551,3 +1575,14 @@ int candoslopes(int sid) {
|
|||
}
|
||||
return B_TRUE;
|
||||
}
|
||||
|
||||
int ismonster(int id) {
|
||||
if (id == P_RAT) return B_TRUE;
|
||||
if (id == P_BEE) return B_TRUE;
|
||||
if (id == P_SPIDER) return B_TRUE;
|
||||
if (id == P_SNAKE) return B_TRUE;
|
||||
if (id == P_CLOUD) return B_TRUE;
|
||||
if (id == P_COKE) return B_TRUE;
|
||||
|
||||
return B_FALSE;
|
||||
}
|
||||
|
|
1
shared.h
|
@ -31,6 +31,7 @@ char monstertochar(int id);
|
|||
tiletype_t *gettile(int tid);
|
||||
void drawtile(SDL_Surface *s, int x, int y);
|
||||
void initglobals(void);
|
||||
int ismonster(int id);
|
||||
|
||||
SDL_Surface *loadspriteimage(int spriteid, int frame, char *filename);
|
||||
#endif
|
||||
|
|
After Width: | Height: | Size: 833 B |
After Width: | Height: | Size: 750 B |
After Width: | Height: | Size: 876 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -1,68 +1,79 @@
|
|||
tileset castle
|
||||
tileset green
|
||||
bg 0
|
||||
hurryup 30
|
||||
hurryup 60
|
||||
endmaps
|
||||
help
|
||||
endhelp
|
||||
monsters
|
||||
1 1 21
|
||||
a 10 3
|
||||
a 35 3
|
||||
r 19 6
|
||||
r 3 7
|
||||
r 37 8
|
||||
s 14 24
|
||||
s 26 24
|
||||
@ 34 8
|
||||
@ 2 7
|
||||
@ 5 7
|
||||
Y 25 6
|
||||
Y 17 6
|
||||
Y 25 11
|
||||
Y 21 11
|
||||
Y 34 11
|
||||
Y 12 11
|
||||
Y 16 11
|
||||
Y 29 11
|
||||
P 20 28
|
||||
P 20 28
|
||||
P 20 28
|
||||
P 34 28
|
||||
P 34 28
|
||||
P 34 28
|
||||
P 34 28
|
||||
P 7 28
|
||||
P 7 28
|
||||
P 7 28
|
||||
P 7 28
|
||||
@ 11 5
|
||||
@ 12 9
|
||||
@ 27 9
|
||||
@ 28 5
|
||||
@ 31 28
|
||||
@ 32 15
|
||||
@ 34 15
|
||||
@ 5 15
|
||||
@ 5 28
|
||||
@ 7 15
|
||||
P 10 19
|
||||
P 11 15
|
||||
P 19 5
|
||||
P 20 5
|
||||
P 21 5
|
||||
P 28 15
|
||||
P 29 19
|
||||
P 30 15
|
||||
P 9 15
|
||||
S 7 5
|
||||
Y 1 15
|
||||
Y 11 9
|
||||
Y 13 9
|
||||
Y 26 9
|
||||
Y 28 9
|
||||
Y 3 15
|
||||
Y 30 28
|
||||
Y 32 28
|
||||
Y 36 15
|
||||
Y 38 15
|
||||
Y 4 28
|
||||
Y 6 28
|
||||
a 31 3
|
||||
a 7 19
|
||||
1 18 15
|
||||
r 27 5
|
||||
r 16 5
|
||||
r 10 12
|
||||
r 29 12
|
||||
r 6 15
|
||||
r 31 15
|
||||
endmonsters
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,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0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,2,1,1,1,3,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,2,4,4,4,4,4,3,0,0,0,0,6,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,2,1,1,3,0,0,6,0,2,4,4,4,4,4,4,4,3,0,0,2,1,3,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,2,4,4,4,4,1,1,1,1,4,4,4,4,4,4,4,4,4,1,1,4,4,4,3,0,0,0,0,0,0,0,4,
|
||||
4,1,1,15,15,15,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,15,15,15,15,15,15,15,4,
|
||||
4,14,14,14,14,14,14,14,14,14,14,14,14,14,1,14,14,14,14,14,4,14,14,14,14,14,1,14,14,14,14,14,14,14,14,14,14,14,14,4,
|
||||
4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,4,
|
||||
4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,4,
|
||||
4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,4,
|
||||
4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,4,
|
||||
4,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,4,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
|
||||
4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,
|
||||
4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,
|
||||
|
|