-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects.h
More file actions
55 lines (40 loc) · 863 Bytes
/
objects.h
File metadata and controls
55 lines (40 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// Created by Aref on 19/06/30.
//
#ifndef GAME_CONSOLE_OBJECTS_H
#define GAME_CONSOLE_OBJECTS_H
#include <time.h>
#define INVALID_POINT (Point){-100, -100}
typedef struct Point Point;
typedef struct Object Object;
typedef struct MoveAction MoveAction;
typedef struct Time Time;
typedef struct AttackAction AttackAction;
struct Point {
int x;
int y;
};
struct MoveAction {
char control;
Point move;
};
struct Object {
Point point;
char charecter;
MoveAction move_dir;
};
struct AttackAction {
char control;
int range;
int flag;
};
struct Time {
float game_length;
float frame_length;
clock_t start_game;
};
void init_move(MoveAction *move, Point point, char r);
Point plus_point(Point a, Point b);
int same_point(Point a, Point b);
void display_point(Point p);
#endif //GAME_CONSOLE_OBJECTS_H