-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathobject.h
More file actions
36 lines (30 loc) · 946 Bytes
/
object.h
File metadata and controls
36 lines (30 loc) · 946 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
#ifndef OBJECT_H
#define OBJECT_H
#include "vect2.h"
#include <cstdio>
class object {
public:
enum class Type { Exit = 1, Food = 2, Killer = 3, Start = 4 };
enum class Property {
None = 0,
GravityUp = 1,
GravityDown = 2,
GravityLeft = 3,
GravityRight = 4
};
vect2 r; // Position in meters
int canvas_x, canvas_y; // Position in canvas pixels
int minimap_canvas_x, minimap_canvas_y; // Position in canvas pixels
Type type;
Property property; // Food gravity
int animation; // Food animation (0-8)
bool active; // true if visible/interactable
double floating_phase; // Floating up/down phase, -Pi to Pi
object(double x, double y, Type typ);
object(FILE* h, int version);
// Render object in editor.
void render();
void save(FILE* h);
double checksum();
};
#endif