Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
christt105 committed Jun 3, 2018
2 parents ae38ef2 + 00a209c commit 573101f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
12 changes: 11 additions & 1 deletion SDL_AndroDunos/Enemy_LongShip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "ModuleCollision.h"
#include "SDL/include/SDL.h"
#include "Globals.h"
#include "ModuleRender.h"


#define PIXEL 24

Expand All @@ -18,7 +20,7 @@ Enemy_LongShip::Enemy_LongShip(int x, int y) : Enemy(x, y)

animation = &fly;

collider = App->collision->AddCollider({ 0, 0, 22, 5 }, COLLIDER_TYPE::COLLIDER_ENEMY, (Module*)App->enemies);
collider = App->collision->AddCollider({ 0, 20, 22, 5 }, COLLIDER_TYPE::COLLIDER_ENEMY, (Module*)App->enemies);

original_y = y;

Expand All @@ -41,3 +43,11 @@ void Enemy_LongShip::Move()
}


void Enemy_LongShip::Draw(SDL_Texture* sprites)
{
if (collider != nullptr)
collider->SetPos(position.x + 4, position.y + 15);


App->render->Blit(sprites, position.x, position.y, &(animation->GetCurrentFrame()));
}
1 change: 1 addition & 0 deletions SDL_AndroDunos/Enemy_LongShip.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Enemy_LongShip : public Enemy
int current_time;
int init_time = 0;
Enemy_LongShip(int x, int y);
void Draw(SDL_Texture* sprites);

void Move();
};
Expand Down
9 changes: 9 additions & 0 deletions SDL_AndroDunos/Enemy_VendingMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "SDL/include/SDL.h"
#include "Globals.h"
#include "ModulePowerUp.h"
#include "ModuleRender.h"

#define PIXEL 32

Expand Down Expand Up @@ -71,3 +72,11 @@ void Enemy_VendingMachine::OnCollision(Collider* collider) {
}


void Enemy_VendingMachine::Draw(SDL_Texture* sprites)
{
if (collider != nullptr)
collider->SetPos(position.x , position.y + 15);


App->render->Blit(sprites, position.x, position.y, &(animation->GetCurrentFrame()));
}
3 changes: 2 additions & 1 deletion SDL_AndroDunos/Enemy_VendingMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Enemy_VendingMachine : public Enemy

Enemy_VendingMachine(int x, int y, bool _drop);
void OnCollision(Collider* collider);

void Draw(SDL_Texture* sprites);

int current_time;
int init_time = 0;
};
Expand Down
2 changes: 2 additions & 0 deletions SDL_AndroDunos/ModuleStage4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ bool ModuleStage4::Start() {
App->collision->AddCollider({ 2255,-110,295,50 }, COLLIDER_WALL4);
App->collision->AddCollider({ 2550,-90,195,50 }, COLLIDER_WALL4);
App->collision->AddCollider({ 2745,-130,100,50 }, COLLIDER_WALL4);
App->collision->AddCollider({ 2845,-130,500,80 }, COLLIDER_WALL4);


App->collision->AddCollider({ 5585,90,50,50 }, COLLIDER_WALL4); //Up 2
App->collision->AddCollider({ 5635,80,160,100 }, COLLIDER_WALL4);
Expand Down

0 comments on commit 573101f

Please sign in to comment.