home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d186
/
cards'o'rama.lha
/
Cards'O'Rama
/
Sources
/
sources.zoo
/
displaydata.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-25
|
3KB
|
101 lines
/* displaydata.c */
/* */
/* This one displays various items: player, turn, score etc. */
displaydata()
{
extern struct RastPort *rp;
extern int turn1;
extern int turn2;
extern int score1;
extern int score2;
extern int enemy;
int baseline;
char *dummystring = "000000";
char *realstring = "000000";
char *opponent = "Computer";
SetDrMd(rp, JAM1);
baseline = rp -> TxBaseline;
SetAPen(rp, 7); /* First the shadow! */
Move(rp, PLAYERX_SHADOW, PLAYERY_SHADOW + baseline);
Text(rp, "Player 1", 8);
SetAPen(rp, COLOR1);
Move(rp, PLAYERX, PLAYERY + baseline);
Text(rp, "Player 1", 8);
SetAPen(rp, 7);
Move(rp, TURNX_SHADOW, TURNY_SHADOW + baseline);
Text(rp, "Turn", 4);
SetAPen(rp, COLOR1);
Move(rp, TURNX, TURNY + baseline);
Text(rp, "Turn", 4);
realstring = intascii(turn1, dummystring, 2);
SetAPen(rp, 7);
Move(rp, TURN_NUMBERX_SHADOW, TURN_NUMBERY_SHADOW + baseline);
Text(rp, realstring, strlen(realstring));
SetAPen(rp, COLOR3);
Move(rp, TURN_NUMBERX, TURN_NUMBERY + baseline);
Text(rp, realstring, strlen(realstring));
SetAPen(rp, 7);
Move(rp, SCOREX_SHADOW, SCOREY_SHADOW + baseline);
Text(rp, "Score", 5);
SetAPen(rp, COLOR1);
Move(rp, SCOREX, SCOREY + baseline);
Text(rp, "Score", 5);
realstring = intascii(score1, dummystring, 5);
SetAPen(rp, 7);
Move(rp, POINTSX_SHADOW, POINTSY_SHADOW + baseline);
Text(rp, realstring, strlen(realstring));
SetAPen(rp, COLOR3);
Move(rp, POINTSX, POINTSY + baseline);
Text(rp, realstring, strlen(realstring));
if (!enemy)
opponent = "Player 2";
SetAPen(rp, 7);
Move(rp, PLAYERX_SHADOW, PLAYERY_SHADOW + baseline + 82);
Text(rp, opponent, strlen(opponent));
SetAPen(rp, COLOR2);
Move(rp, PLAYERX, PLAYERY + baseline + 82);
Text(rp, opponent, strlen(opponent));
SetAPen(rp, 7);
Move(rp, TURNX_SHADOW, TURNY_SHADOW + baseline + 82);
Text(rp, "Turn", 4);
SetAPen(rp, COLOR2);
Move(rp, TURNX, TURNY + baseline + 82);
Text(rp, "Turn", 4);
realstring = intascii(turn2, dummystring, 2);
SetAPen(rp, 7);
Move(rp, TURN_NUMBERX_SHADOW, TURN_NUMBERY_SHADOW + baseline + 82);
Text(rp, realstring, strlen(realstring));
SetAPen(rp, COLOR3);
Move(rp, TURN_NUMBERX, TURN_NUMBERY + baseline + 82);
Text(rp, realstring, strlen(realstring));
SetAPen(rp, 7);
Move(rp, SCOREX_SHADOW, SCOREY_SHADOW + baseline + 82);
Text(rp, "Score", 5);
SetAPen(rp, COLOR2);
Move(rp, SCOREX, SCOREY + baseline + 82);
Text(rp, "Score", 5);
realstring = intascii(score2, dummystring, 5);
SetAPen(rp, 7);
Move(rp, POINTSX_SHADOW, POINTSY_SHADOW + baseline + 82);
Text(rp, realstring, strlen(realstring));
SetAPen(rp, COLOR3);
Move(rp, POINTSX, POINTSY + baseline + 82);
Text(rp, realstring, strlen(realstring));
return(0);
}