File: score.c

package info (click to toggle)
ketm 0.0.6-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,356 kB
  • ctags: 875
  • sloc: ansic: 7,303; sh: 410; makefile: 185
file content (80 lines) | stat: -rw-r--r-- 1,615 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "score.h"

extern HSC_LIST hsc_table[];
extern SDL_Surface *screen;
extern SPRITE *player;


void score_display()
{
	PLAYER_DATA *p=(PLAYER_DATA *)player->data;
	char buffer[100];

	sprintf(buffer,"SCORE : %06d   HI-SCORE: %06d",p->score,
			p->score>=hsc_table[0].score ? p->score : hsc_table[0].score);
	font_print(buffer,FONT07,0,0);

	sprintf(buffer,"SHIPS : %d",p->lives);
	font_print(buffer,FONT07,0,10);

	sprintf(buffer,"SPEED : %d",p->player_speed);
	font_print(buffer,FONT07,0,20);

	sprintf(buffer,"STAGE : %d",p->level);
	font_print(buffer,FONT07,0,30);

	sprintf(buffer,"WEAPON: ");
	switch(p->weapon) {
	case WP_PLASMA:
		strcat(buffer,"PLASMA");
		break;
	case WP_DOUBLEPLASMA:
		strcat(buffer,"DOUBLE-PLASMA");
		break;
	case WP_QUADPLASMA:
		strcat(buffer,"QUAD-PLASMA");
		break;
	case WP_FIREBALL:
		strcat(buffer,"FIRERAY");
		break;
	case WP_DOUBLEFIREBALL:
		strcat(buffer,"DOUBLE-FIRERAY");
		break;
	case WP_QUADFIREBALL:
		strcat(buffer,"QUAD-FIRERAY");
		break;
	case WP_KILLRAY:
		strcat(buffer,"KILLRAY");
		break;
	default:
		strcat(buffer,"UNKNOWN ???");
		break;
	}
	font_print(buffer,FONT07,0,40);
	
	if(p->extra!=PLX_NONE) {
		sprintf(buffer,"EXTRA : ");
		switch(p->extra) {
		case PLX_HOMING:
			strcat(buffer,"HOMING MISSILE");
			break;
		case PLX_SHIELD:
			strcat(buffer,"SHIELD");
			break;
		case PLX_HLASER:
			strcat(buffer,"HOMING LASER");
			break;
		default:
			strcat(buffer,"UNKNOWN ???");
			break;
		}
		font_print(buffer,FONT07,0,50);
		sprintf(buffer,"X-TIME: %d",(int)p->extra_time/10);
		font_print(buffer,FONT07,0,60);
	}

}

void score_cleanup()
{
}