pvjc25/du8/world.h
2025-06-12 13:00:33 +02:00

22 lines
682 B
C

#ifndef _WORLD_H_
#define _WORLD_H_
#include <curses.h>
enum event_type { EVENT_START, EVENT_TIMEOUT, EVENT_KEY, EVENT_RESIZE, EVENT_ESC, EVENT_END };
struct event {
int width, height, key, alt_key, mouse_x, mouse_y, mouse_left, mouse_right, mouse_middle;
enum event_type type;
long int time_ms;
};
void set_cell(int character, int x, int y);
void set_color_cell(int character, int x, int y, short front_color, short back_color);
int start_world(void* (*init_game)(), int (*world_event)(struct event* event, void* game), void (*destroy_game)(void* game));
void game_speed(int value);
void set_message(const char* message, int x, int y);
void clear_screen();
#endif