diff --git a/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj b/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj
index 070cef7..6ac3c69 100644
--- a/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj
+++ b/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj
@@ -91,6 +91,19 @@
true
true
+
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+
Level3
diff --git a/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj.filters b/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj.filters
index 573489a..8e6ce7c 100644
--- a/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj.filters
+++ b/Assignment3Project/Assignment3Project/Assignment3Project.vcxproj.filters
@@ -101,12 +101,12 @@
Source Files\ScreensImplement
-
- Source Files
-
Source Files\ScreensImplement
+
+ Source Files\Assignment3Implement
+
diff --git a/Assignment3Project/Assignment3Project/bullet.cpp b/Assignment3Project/Assignment3Project/bullet.cpp
index f1693de..9d29b60 100644
--- a/Assignment3Project/Assignment3Project/bullet.cpp
+++ b/Assignment3Project/Assignment3Project/bullet.cpp
@@ -2,6 +2,7 @@
Bullet::Bullet(Behavior _behavior) {
behavior = _behavior;
+ //Build properties based on behavior
switch (behavior) {
case Enemy:
speed = 1.0;
@@ -38,6 +39,7 @@ void Bullet::move(Direction dir) {
y_pos += 6;
break;
}
+ //Only player bullets are used currently so only player bullet bound is checked
if (y_pos < 0 - height) {
oob = true;
}
diff --git a/Assignment3Project/Assignment3Project/bullet.h b/Assignment3Project/Assignment3Project/bullet.h
index c616fc8..ce7b8f5 100644
--- a/Assignment3Project/Assignment3Project/bullet.h
+++ b/Assignment3Project/Assignment3Project/bullet.h
@@ -3,6 +3,7 @@
#include "game_element.h"
+//Bullet fired by ships
class Bullet : public GameElement {
public:
Bullet(Behavior _behavior);
diff --git a/Assignment3Project/Assignment3Project/enums.h b/Assignment3Project/Assignment3Project/enums.h
index 9523b53..832a68f 100644
--- a/Assignment3Project/Assignment3Project/enums.h
+++ b/Assignment3Project/Assignment3Project/enums.h
@@ -7,6 +7,7 @@
#define TILE_SIZE 40
#define LEVEL_LEN 120
+//State machine states
enum State {
Start,
Gameplay,
@@ -15,6 +16,7 @@ enum State {
Exit
};
+//Movement directions
enum Direction {
U,
D,
@@ -26,17 +28,20 @@ enum Direction {
DL
};
+//Game object behaviors
enum Behavior {
Player,
Enemy
};
+//Define current background layer for scrolling
enum BgLayer {
Front,
Middle,
Back
};
+//Game object hitbox for collision detection
struct Hitbox {
int x;
int y;
@@ -44,12 +49,14 @@ struct Hitbox {
int width;
};
+//Struct for enemy queue
struct NewEnemy {
int x;
Behavior e_type;
int when;
};
+//When inputs must be delayed by a number of frames (no longer used, kept for possible future use
struct InputDelay {
bool input_hit;
int delay_sec;
diff --git a/Assignment3Project/Assignment3Project/game_element.h b/Assignment3Project/Assignment3Project/game_element.h
index 636fa58..c33bbc5 100644
--- a/Assignment3Project/Assignment3Project/game_element.h
+++ b/Assignment3Project/Assignment3Project/game_element.h
@@ -3,6 +3,7 @@
#include "enums.h"
+//Game Element base class, with position, height, and screen bounding properties along with its behavior
class GameElement {
public:
float x_pos;
@@ -16,9 +17,13 @@ public:
float width;
bool oob;
Behavior behavior;
-
+
+ //Set position of object
virtual void reset_pos(float x, float y) = 0;
+ //Move object
virtual void move(Direction dir) = 0;
+ //Draw object to screen
virtual void draw() = 0;
+ //Build hitbox struct for the object at position in current frame
virtual Hitbox get_hitbox() = 0;
};
\ No newline at end of file
diff --git a/Assignment3Project/Assignment3Project/game_screen.cpp b/Assignment3Project/Assignment3Project/game_screen.cpp
index 7008edb..4655a03 100644
--- a/Assignment3Project/Assignment3Project/game_screen.cpp
+++ b/Assignment3Project/Assignment3Project/game_screen.cpp
@@ -10,7 +10,7 @@
#include