I am new to programming and I have no knowledge to create the score, he is already ready I know not to make it appear on the screen, I need you guys to help, if not possible I also thank,
I want to show on the screen 0-0 whenever one of the players to win it changes 1-0
the code is in github
GitHub - ROBSONS2007/score[
^]
score game kof98:
#define STATE_IDLE 0
#define STATE_STARTING 1
#define STATE_RUNNING 2
#define RUN_COUNT (60 * 12)
static struct {
int state;
int runcount;
char *game;
struct {
char *id;
int rounds;
} p[2];
} GameInfo = { 0 };
extern bool SpriteInList(const QuarkSpriteInfo *s, QuarkSprite sprites[], int count);
extern int QuarkFindSprite(QuarkSprite sprites[], int count, int x, int y);
static void
QuarkSpriteStartNewGame(GGPOSession *ggpo, char *game)
{
for (int i = 0; i < 2; i++) {
GameInfo.p[i].rounds = 0;
GameInfo.p[i].id = NULL;
}
GameInfo.runcount = RUN_COUNT;
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_STARTING, game);
}
static void
QuarkSpriteFinishGame(GGPOSession *ggpo)
{
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_PLAYER_1, (void *)"kof98");
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_PLAYER_2, (void *)"kof98");
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_PLAYER_1_SCORE, (void *)GameInfo.p[0].rounds);
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_PLAYER_2_SCORE, (void *)GameInfo.p[1].rounds);
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_WINNER, (void *)(GameInfo.p[0].rounds > GameInfo.p[1].rounds ? 1 : 2));
ggpo_client_set_game_event(ggpo, GGPOCLIENT_GAMEEVENT_FINISHED, NULL);
}
static bool
P1PlayerNameVisible(QuarkSprite sprites[], int count)
{
const int a = 865;
const int z = a + 26;
for (int i = 0; i < count; i++) {
if (sprites[i].x == 48 && sprites[i].y == 32 && sprites[i].id >= a && sprites[i].id <= z) {
return true;
}
}
return false;
}
static bool
CharSelectTimeCountdown(QuarkSprite sprites[], int count)
{
static const struct {
int id, x, y;
} matches[] = {
{ 1672, 136, 192 }, { 1673, 144, 192 }, { 1674, 152, 192 }, { 1675, 160, 192 }, };
int c = 0;
for (int i = 0; i < count; i++) {
for (int j = 0; j < _ARRAYSIZE(matches); j++) {
if (sprites[i].x == matches[j].x &&
sprites[i].y == matches[j].y &&
sprites[i].id == matches[j].id) {
c++;
if (c == _ARRAYSIZE(matches)) {
return true;
}
}
}
}
return false;
}
void
QuarkProcessKOF98Sprites(GGPOSession *ggpo, QuarkSprite sprites[], int count)
{
static const struct {
char *character;
int p[2];
} search[] = {
{ "Kyo", { 00000, 00000 } },
{ "Benimaru", { 00000, 00000 } },
{ "Daimon", { 00000, 00000 } },
{ "Terry", { 00000, 00000 } },
{ "Andy", { 00000, 00000 } },
{ "Joe", { 00000, 00000 } },
{ "Ryo", { 00000, 00000 } },
{ "Robert", { 00000, 00000 } },
{ "Yuri", { 00000, 00000 } },
{ "Leona", { 00000, 00000 } },
{ "Ralf", { 00000, 00000 } },
{ "Clark", { 00000, 00000 } },
{ "Athena", { 00000, 00000 } },
{ "Kensou", { 00000, 00000 } },
{ "Chin", { 00000, 00000 } },
{ "Mai", { 00000, 00000 } },
{ "King", { 00000, 00000 } },
{ "Chizuru", { 00000, 00000 } },
{ "Kim", { 00000, 00000 } },
{ "Choi", { 00000, 00000 } },
{ "Chang", { 00000, 00000 } },
{ "Yashiro", { 00000, 00000 } },
{ "Shermie", { 00000, 00000 } },
{ "Chris", { 00000, 00000 } },
{ "Billy", { 00000, 00000 } },
{ "Yamazaki", { 00000, 00000 } },
{ "Mary", { 00000, 00000 } },
{ "Iori", { 00000, 00000 } },
{ "Mature", { 00000, 00000 } },
{ "Vice", { 00000, 00000 } },
{ "Heidern", { 00000, 00000 } },
{ "Takuma", { 00000, 00000 } },
{ "Saishu", { 00000, 00000 } },
{ "HeavyD", { 00000, 00000 } },
{ "Lucky", { 00000, 00000 } },
{ "Brian", { 00000, 00000 } },
{ "Rugal", { 00000, 00000 } },
{ "Shingo", { 00000, 00000 } },
{ "Kyo 94", { 00000, 00000 } },
{ "Terry 94", { 00000, 00000 } },
{ "Andy 94", { 00000, 00000 } },
{ "Joe 94", { 00000, 00000 } },
{ "Ryo 94", { 00000, 00000 } },
{ "Robert 94", { 00000, 00000 } },
{ "Yuri 94", { 00000, 00000 } },
{ "Mai 94", { 00000, 00000 } },
{ "Orochi Yashiro", { 00000, 00000 } },
{ "Orochi Shermie", { 00000, 00000 } },
{ "Orochi Chris", { 00000, 00000 } },
{ "Billy 94", { 00000, 00000 } },
{ "Rugal Omega", { 00000, 00000 } },
};
if (GameInfo.state == STATE_IDLE) {
if (P1PlayerNameVisible(sprites, count)) {
QuarkSpriteStartNewGame(ggpo, "kof98");
GameInfo.state = STATE_RUNNING;
}
} else if (GameInfo.state == STATE_RUNNING) {
if (P1PlayerNameVisible(sprites, count)) {
GameInfo.runcount = RUN_COUNT;
} else {
GameInfo.runcount--;
}
unsigned char *start = pVidImage + nVidImagePitch;
if (GameInfo.runcount == 0 ||
memcmp(scanline_red_4, start, sizeof(scanline_red_4)) == 0 ||
memcmp(scanline_blue_4, start, sizeof(scanline_blue_4)) == 0 ||
memcmp(scanline_challenge_4, start, sizeof(scanline_challenge_4)) == 0 ||
CharSelectTimeCountdown(sprites, count)) {
QuarkSpriteFinishGame(ggpo);
GameInfo.state = STATE_IDLE;
}
}
}
int VidSUpdateSpectatorCount(int spectatorCount)
{
if (spectatorCount) {
_sntprintf(szSpectatorCount, 256, _T("%d spectator%s"), spectatorCount, spectatorCount > 1 ? "s" : "");
}
else {
_sntprintf(szSpectatorCount, 256, _T(""));
}
bDrawTV = true;
return 0;
}
int VidSDrawTV(RECT *rcDest){
SetTextAlign(hDC, TA_TOP | TA_RIGHT);
MyTextOut(hDC, pTVSurfRight - 4, 4, szSpectatorCount, strlen(szSpectatorCount), nChatShadowOffset, RGB(0xcc, 0xcc, 0xcc))
}
What I have tried:
SetTextAlign(hDC, TA_TOP | TA_RIGHT);
MyTextOut(hDC, pTVSurfRight - 4, 4, pScoreInfo, strlen(pScoreInfo), nChatShadowOffset, RGB(0xcc, 0xcc, 0xcc));
I tried it could not, as we have already said I am new to programming