aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/entity.cpp8
-rw-r--r--src/entity.hpp11
-rw-r--r--src/gameplay.cpp12
-rw-r--r--src/gameplay.hpp8
-rw-r--r--src/weapon.cpp16
-rw-r--r--src/weapon.hpp18
-rw-r--r--src/window.cpp8
-rw-r--r--src/window.hpp8
8 files changed, 86 insertions, 3 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 9f3b35f..69bec00 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -1,3 +1,11 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* entity ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
#include "entity.hpp"
Entity::Entity(void) : hp(1)
diff --git a/src/entity.hpp b/src/entity.hpp
index 995c0b4..190df40 100644
--- a/src/entity.hpp
+++ b/src/entity.hpp
@@ -1,14 +1,25 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* entityh ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
#ifndef ENEMY_H_
#define ENEMY_H_
#include "window.hpp"
+#include "weapon.hpp"
+
class Entity {
public:
int hp;
float posX;
float posY;
Vector2 direction;
+ Weapon * wp;
Entity();
~Entity();
};
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 16fc240..15f96bd 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -1,3 +1,11 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* gameplay ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
#include "gameplay.hpp"
#include <iostream>
@@ -6,7 +14,7 @@
Game::Game(void)
{
- nEnemies = 9;
+ nEnemies = 10;
enemies = new std::vector<Entity>(nEnemies);
player = new Entity;
@@ -45,8 +53,6 @@ int Game::tick() const
{
for (auto & en : *enemies)
{
- if (!en.hp)
- { continue ; }
if (en.posX >= SCREENWIDTH || en.posX <= 0) {
en.direction.x = -en.direction.x;
}
diff --git a/src/gameplay.hpp b/src/gameplay.hpp
index 4ff3608..06ed0a7 100644
--- a/src/gameplay.hpp
+++ b/src/gameplay.hpp
@@ -1,3 +1,11 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* gameplayh ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
#ifndef GAMEPLAY_H_
#define GAMEPLAY_H_
diff --git a/src/weapon.cpp b/src/weapon.cpp
new file mode 100644
index 0000000..74bf960
--- /dev/null
+++ b/src/weapon.cpp
@@ -0,0 +1,16 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* weapon ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
+#include "weapon.hpp"
+
+Weapon::Weapon()
+{
+
+}
+
+Weapon::~Weapon() {}
diff --git a/src/weapon.hpp b/src/weapon.hpp
new file mode 100644
index 0000000..72d719f
--- /dev/null
+++ b/src/weapon.hpp
@@ -0,0 +1,18 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* weaponh ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
+#ifndef WEAPON_H_
+#define WEAPON_H_
+
+class Weapon {
+ public:
+ Weapon();
+ ~Weapon();
+};
+
+#endif // WEAPON_H_
diff --git a/src/window.cpp b/src/window.cpp
index 17731c0..0a51470 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1,3 +1,11 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* window ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
#include "window.hpp"
int
diff --git a/src/window.hpp b/src/window.hpp
index 74fd3ec..6316bfa 100644
--- a/src/window.hpp
+++ b/src/window.hpp
@@ -1,3 +1,11 @@
+/*********************************/
+/* THRESHOLD ( // */
+/* windowh ( )/ */
+/* by salade )(/ */
+/* ________________ ( /) */
+/* ()__)____________))))) :^} */
+/*********************************/
+
#ifndef WINDOW_H_
#define WINDOW_H_