77 lines
1.1 KiB
C
77 lines
1.1 KiB
C
|
#include <tty.h>
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <drivers/ps2_keyboard.h>
|
||
|
|
||
|
#include <builtin_games/miner.h>
|
||
|
|
||
|
|
||
|
#define PLAYER '@'
|
||
|
#define SHOP '$'
|
||
|
#define STONE '#'
|
||
|
#define IRON ';'
|
||
|
#define COAL ':'
|
||
|
#define COPPER '^'
|
||
|
#define GOLD '%'
|
||
|
#define RUBY '*'
|
||
|
#define DIAMOND '~'
|
||
|
#define PLATINUM '&'
|
||
|
#define NOTHING ' '
|
||
|
|
||
|
|
||
|
/*
|
||
|
static const size_t VGA_WIDTH = 80;
|
||
|
static const size_t VGA_HEIGHT = 25;
|
||
|
*/
|
||
|
|
||
|
|
||
|
|
||
|
void miner_main(void)
|
||
|
{
|
||
|
terminal_clear();
|
||
|
|
||
|
printf("\n\tMiner\n\t\tMine ores to sell for money and upgrade your drone\n\n\n\t\t\tHIT ENTER TO CONTINUE, TAB TO EXIT\n");
|
||
|
|
||
|
char b = get_char();
|
||
|
|
||
|
while (b != '\n' && b != '\t')
|
||
|
{
|
||
|
sleep(10);
|
||
|
b = get_char();
|
||
|
}
|
||
|
|
||
|
if (b == '\t')
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
uint16_t c = 0x0;
|
||
|
|
||
|
terminal_clear();
|
||
|
|
||
|
while (true)
|
||
|
{
|
||
|
sleep(10);
|
||
|
|
||
|
c = get_key();
|
||
|
|
||
|
if (c == 0xFFFA || c == 0x0)
|
||
|
{
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
b = getchar();
|
||
|
|
||
|
while (b == 0x5)
|
||
|
{
|
||
|
sleep(10);
|
||
|
b = getchar();
|
||
|
}
|
||
|
|
||
|
terminal_clear();
|
||
|
}
|