Skip to content

Commit

Permalink
fase 5 pontuacao
Browse files Browse the repository at this point in the history
  • Loading branch information
ezefranca committed Nov 24, 2013
1 parent 1913229 commit bf89624
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin/data/config/user.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
personagem=1
last_phase=0
personagem=1
17 changes: 10 additions & 7 deletions make/src/Fases/Fase5/fase5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
#include "fase5.h"
#include "../../Player.h"

void createLevelCinco(LevelCinco *levelCinco){
void createLevelCinco(LevelCinco *levelCinco, Player *player){
player->chances = 0;
levelCinco->circ1_on = al_load_bitmap("./data/levels/fase5/circ1_on.png");
levelCinco->circ2_on = al_load_bitmap("./data/levels/fase5/circ2_on.png");

levelCinco->circ1_off = al_load_bitmap("./data/levels/fase5/circ1_off.png");
levelCinco->circ2_off = al_load_bitmap("./data/levels/fase5/circ2_off.png");

levelCinco->circ3 = al_load_bitmap("./data/levels/fase5/circ3_on.png");

levelCinco->circ_base = al_load_bitmap("./data/levels/fase5/circ_base.png");
}

void logicLevelCinco(bool *gateOne, bool *gateTwo, Player *player)
{
if((player->state.x > 40 && player->state.x < 160) && (player->state.y > 30 && player->state.y < 107))
{
player->chances++;
if(*gateOne == false){
*gateOne = true;
printf("False para true\n");
Expand All @@ -29,6 +31,7 @@ void logicLevelCinco(bool *gateOne, bool *gateTwo, Player *player)
}
if((player->state.x > 40 && player->state.x < 160) && (player->state.y > 106 && player->state.y < 167))
{
player->chances++;
if(*gateTwo == false){
*gateTwo = true;
printf("False para true\n");
Expand Down Expand Up @@ -112,11 +115,11 @@ void drawLevelCinco(LevelCinco *levelCinco){
void destroyLevelCinco(LevelCinco *levelCinco){
al_destroy_bitmap(levelCinco->circ1_on);
al_destroy_bitmap(levelCinco->circ2_on);

al_destroy_bitmap(levelCinco->circ1_off);
al_destroy_bitmap(levelCinco->circ2_off);
al_destroy_bitmap(levelCinco->circ3);

al_destroy_bitmap(levelCinco->circ3);

al_destroy_bitmap(levelCinco->circ_base);
}
8 changes: 4 additions & 4 deletions make/src/Fases/Fase5/fase5.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
typedef struct {
ALLEGRO_BITMAP *circ1_on;
ALLEGRO_BITMAP *circ2_on;

ALLEGRO_BITMAP *circ1_off;
ALLEGRO_BITMAP *circ2_off;

ALLEGRO_BITMAP *circ1;
ALLEGRO_BITMAP *circ2;
ALLEGRO_BITMAP *circ3;

ALLEGRO_BITMAP *circ_base;

bool isOn[5];

} LevelCinco;


void createLevelCinco(LevelCinco *levelCinco);
void createLevelCinco(LevelCinco *levelCinco, Player *player);
void logicLevelCinco(bool *gateOne, bool *gateTwo, Player *player);
void initDrawGatesLevelCinco(LevelCinco *LevelCinco);
void drawLevelCinco(LevelCinco *LevelCinco);
Expand Down
4 changes: 2 additions & 2 deletions make/src/gameloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void GameLoop(ALLEGRO_EVENT ev)
limpa_config();
limpa_idioma();
limpa_config_user();
//al_destroy_sample_instance(game.songInstance);
al_destroy_sample_instance(game.songInstance);
}
if(ev.type == ALLEGRO_EVENT_KEY_DOWN)
{
Expand Down Expand Up @@ -176,7 +176,7 @@ void GameLoop(ALLEGRO_EVENT ev)
{
levelCinco = malloc(sizeof(LevelCinco));
game.level = 5;
createLevelCinco(levelCinco);
createLevelCinco(levelCinco, player);
initDrawGatesLevelCinco(levelCinco);
drawLogicLevelCinco(inputs[0], inputs[1], levelCinco, &complete);
printf("Objetivo completo\n");
Expand Down

0 comments on commit bf89624

Please sign in to comment.