Fumofumotris/source/fumotris/fumotris.c

35 lines
613 B
C
Raw Normal View History

2024-05-07 22:10:15 +00:00
#include "fumotris.h"
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
void Update(struct FumoInstance *instance, void *args)
2024-05-02 22:17:37 +00:00
{
2024-05-07 22:10:15 +00:00
struct Fumotris *game = args;
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
TetrMapDraw(&game->board, &instance->term);
}
2024-05-07 03:29:10 +00:00
2024-05-07 22:10:15 +00:00
bool CreateFumotris(struct Fumotris *game)
{
if (!CreateTetrMap(&game->board, 10, 10))
return false;
2024-05-06 05:52:30 +00:00
2024-05-07 22:10:15 +00:00
return true;
2024-05-02 22:17:37 +00:00
}
int main()
{
2024-05-07 22:10:15 +00:00
struct FumoInstance instance;
CreateFumoInstance(&instance);
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
struct Fumotris game;
CreateFumotris(&game);
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
ControllerMapMulti(&instance.ctrl, CODE_COUNT, MAPPINGS);
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
FumoInstanceHook(&instance.on_update, Update, &game);
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
FumoInstanceRun(&instance);
2024-05-02 22:17:37 +00:00
2024-05-07 22:10:15 +00:00
return 0;
}