pvjc25/a4/world.h
2025-05-02 19:50:28 +02:00

37 lines
746 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _WORLD_H_
#define _WORLD_H_
struct event {
int type;
int key;
int height;
int width;
int time_ms;
int mouse_x;
int mouse_y;
int mouse_left;
int mouse_right;
int mouse_middle;
int alt_key;
};
#define EVENT_KEY 1
#define EVENT_MOUSE 2
#define EVENT_RESIZE 3
#define EVENT_ESC 4
#define EVENT_TIMEOUT 5
#define EVENT_START 6
#define COLOR_COUNT 8
void clear_screen();
void set_cell(int c, int x, int y);
void set_message(const char* msg, int x, int y);
void set_color_cell(int c, int x, int y, short f, short b);
void game_speed(int v);
void abort_game(const char* m);
int world_run(void* (*init_game)(), int (*world_event)(struct event*, void*)); // ← ВОТ ЭТА СТРОЧКА
#endif