return 0;
};
+int sliding_wall(struct Rectangle *rect)
+{
+ // definition of sliding: not on floor + wall collision rect is >1 high and 1 wide
+ if (on_floor(rect)) {
+ return 0;
+ } else {
+ for (int i = 0; i < stages[level].platform_count; i++) {
+ //printf("check slide");
+ Rectangle *check = &(stages[level].platforms[i].rect);
+ if (CheckCollisionRecs(*rect, *check)) {
+ printf("colliding!!");
+ Rectangle overlap = (GetCollisionRec(*rect, *check));
+ if ((overlap.height > 1) &&( overlap.width == 1)) {
+ printf("sliding!!");
+ return 1;
+ }
+ }
+ }
+ };
+ return 0;
+};
+
int is_killed(struct Rectangle *rect) {
for (int i = 0; i < stages[level].danger_count; i++) {
if (CheckCollisionRecs(*rect, stages[level].dangers[i].rect)) {
-#define STAGECOUNT 4
-#define DIALOGUECOUNT 10
-#define PLATFORMCOUNT 9
+#define STAGECOUNT 5
+#define DIALOGUECOUNT 11
+#define PLATFORMCOUNT 12
#define DANGERCOUNT 5
#include "game.h"
{"Those red squares are dangerous!! Don't touch them.", "Ai-chan", "dialogue-img/aichan-angry.png", GREEN},
+ {"To wall-jump, slide on a wall and press the JUMP key.", "Ai-chan", "dialogue-img/aichan-smile.png", GREEN},
{"YOU WIN!!", "Ai-chan", "dialogue-img/aichan-smile.png", GREEN}
};
{{0, 320, 640, 160}, GREEN},
+
{{0,320,80,160},GREEN},
{{100,300,80,10}, GREEN},
{{200,270,60,10}, GREEN},
{{280,240,230,10}, GREEN},
- {{560,420,80,160}, GREEN}
+ {{560,420,80,160}, GREEN},
+
+
+ {{0,320,640,160},GREEN},
+ {{400,80,80,200}, GREEN},
+ {{540,100,100,200},GREEN}
};
struct platform danger[DANGERCOUNT] = {
{"Movement", platforms, 1, dialogues, 7, danger, 0},
{"Jumping", platforms+1, 2, dialogues+7, 1, danger, 0},
{"Danger", platforms+3, 1, dialogues+8, 1, danger, 4},
- {"(level)", platforms+4, 5, dialogues+8,1,danger+4,1}
+ {"(level)", platforms+4, 5, dialogues+8,1,danger+4,1},
+ {"Wall-jumping", platforms+9, 3,dialogues+9,1,danger,0}
};