From: Clyne Sullivan Date: Thu, 10 Sep 2015 15:31:30 +0000 (-0400) Subject: added entities X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=a3db993224c994fdff6f50fedcc266c5e0b94aa8;p=clyne%2Fgamedev.git added entities --- diff --git a/doc/World.htm b/doc/World.htm new file mode 100644 index 0000000..d17c551 --- /dev/null +++ b/doc/World.htm @@ -0,0 +1,40 @@ + + + + World + + + +

World

+
+

Description

+

World.h contains functions to create and draw worlds, and provide basic object detection.

+
+

The standard form of world generation in World.h is an array of randomly sized vertical lines. +The width of each line is defined as a single HLINE, a macro defined in common.h. ...

+

class World

+
private:
+ struct line_t {
+ float start;
+ } *line;
+ unsigned int lineCount;
+public:
+ World(float width);
+ void draw(void);
+ void detect(vec2 *v,const float width);
+
+ + + diff --git a/include/entities.h b/include/entities.h new file mode 100644 index 0000000..3ecf014 --- /dev/null +++ b/include/entities.h @@ -0,0 +1,26 @@ +#ifndef ENTITIES_H +#define ENTITIES_H + +#include + + +class Entities{ +public: + float width; + float height; + float speed; + int type; + vec2 loc; + + void spawn(float, float); + + +}; + +class Player : public Entities{ +public: + Player(); + ~Player(); +}; + +#endif //ENTITIES_H \ No newline at end of file diff --git a/src/entities.cpp b/src/entities.cpp new file mode 100644 index 0000000..5e86b72 --- /dev/null +++ b/src/entities.cpp @@ -0,0 +1,16 @@ +#include + +void Entities::spawn(float x, float y){ + loc.x = x; + loc.y = y; + +} + +Player::Player(){ + width = 24; + height = 42; + speed = 1; + type = 0; +} + +Player::~Player(){} \ No newline at end of file