Skip to content

Commit

Permalink
GG ig
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhijnanVegi committed Feb 21, 2022
1 parent d27aeed commit 900b80b
Show file tree
Hide file tree
Showing 6 changed files with 939 additions and 18 deletions.
4 changes: 3 additions & 1 deletion include/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Game
bool Keys[1024];
unsigned int Width, Height;
unsigned int Score;
unsigned int HP;
int HP;
float Time;
Camera Cam;
std::vector<GameObject> Enemies;
std::vector<Projectile> Projectiles;
Expand All @@ -38,6 +39,7 @@ class Game
void Update(float dt);
void Render();
void ToggleCamera();
void Shoot();
};

#endif
6 changes: 3 additions & 3 deletions include/game_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class GameObject
glm::vec3 Position, Scale;
float Rotation;
Model ObjectModel;
bool Destroyed;
float Cooldown;
// constructor(s)
GameObject(const glm::vec3 &Position,const glm::vec3 &Scale,const float Rotation, string const &path): ObjectModel(path), Destroyed(false)
GameObject(const glm::vec3 &Position,const glm::vec3 &Scale,const float Rotation, string const &path): ObjectModel(path), Cooldown(0)
{
this->Position = Position;
this->Scale = Scale;
Expand All @@ -42,7 +42,7 @@ class Projectile: public GameObject

void Update(float dt)
{
this->Position += this->Velocity * dt;
this->Position += this->Velocity * (dt * 4);
}
};

Expand Down
12 changes: 12 additions & 0 deletions models/sphere.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl Default_OBJ
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.000000 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
Loading

0 comments on commit 900b80b

Please sign in to comment.