diff options
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..42f55f7 --- /dev/null +++ b/src/common.h @@ -0,0 +1,17 @@ +#ifndef COMMON_H
+#define COMMON_H
+
+// Box2D works best for objects of size 0.1m ... 10m
+// So we have a miniature world this time, makes easier to make things happen when
+// used forces are not too big, and nothing too surprising should not happen either...
+// 16px = 0.1m
+// this makes our main character as 32px * 64px ( 20cm wide and 40cm tall )
+#define _PMF (0.1f / 16.0f)
+
+#define P2M(x) ((x) * (_PMF))
+#define M2P(x) ((x) / (_PMF))
+
+#define FPS 60
+#define FRAME_INTERVAL (1000 / FPS)
+
+#endif
|
