} else {
drawdialogue(stages[level].dialogues+current_dialogue);
if (IsKeyPressed(ADVANCEKEY)) {
- if (++current_dialogue == stages[level].dialogue_count) { //dialogue over
+ if (++current_dialogue >= stages[level].dialogue_count) { //dialogue over
current_dialogue = 0; //is this not activating or smth...
frozen = 0;
- }
- }
- }
+ } else {
+ int max_dialogue = currstage->dialogue_count;
+ };
+ };
+ };
} else if (frozen > 1) { //currently interacting with an object
struct object *o = currstage->objects + (frozen - 2);
drawdialogue(o->dialogues + current_dialogue);
return 0;
};
-int is_killed(struct Rectangle *rect) {
+int is_killed(struct Rectangle *rect)
+{
struct stage *s = &stages[level];
for (int i = 0; i < s->danger_count; i++) {
- if (CheckCollisionRecs(*rect, s->dangers[i].rect)) {
+ if (CheckCollisionRecs(*rect, s->dangers[i].rect)) { //if they're killed ill ... just remove the coins here lmao :p not a good idea but like. it'll be fine
+ for (int n = 0; n < s->coingroup_count; n++) {
+ struct coingroup *cg = s->coingroups+n;
+ for (int x = 0; x < cg->coin_count; x++) {
+ cg->collected[x]=0;
+ };
+ };
return 1;
};
};
for (int i = 0; i < (s->coingroup_count); i++) {
struct coingroup *cg = s->coingroups+i;
for (int n = 0; n < (cg->coin_count); n++) {
- if ((cg->collected[n] == 0) && (CheckCollisionRecs(*rect,(Rectangle){(cg->position.x + 2 + n * (COINPADDING + COINWIDTH)), cg->position.y, COINWIDTH - 2, COINWIDTH}))) {
+ if ((cg->collected[n] == 0) && (CheckCollisionRecs(*rect,(Rectangle){(cg->position.x + 2 + n * (cg->padding + COINWIDTH)), cg->position.y, COINWIDTH - 4, COINWIDTH}))) {
collectcoin(cg, n);
};
};
for (int i = 0; i < cg->coin_count; i++) {
if (cg->collected[i] == 0) {
//draw the coin :3
- DrawTexture(coin_txtr, cg->position.x + i * (COINWIDTH + COINPADDING), cg->position.y, WHITE);
+ DrawTexture(coin_txtr, cg->position.x + i * (COINWIDTH + cg->padding), cg->position.y, WHITE);
};
};
};
#define PLATFORMCOUNT 83
#define DANGERCOUNT 34
#define OBJECTCOUNT 5
-#define COINCOUNT 32
-#define COINGROUPCOUNT 1
+#define COINCOUNT 106
+#define COINGROUPCOUNT 11
#include "game.h"
#include <stddef.h>
};
struct platform danger[DANGERCOUNT] = {
- {{80,310,7,10}, RED},
- {{160,310,7,10}, RED},
- {{240,310,7,10}, RED},
- {{320,310,7,10}, RED},
+ {{80,310,10,10}, RED},
+ {{160,310,10,10}, RED},
+ {{240,310,10,10}, RED},
+ {{320,310,10,10}, RED},
{{80,440,480,40}, RED},
int collected_coins[COINCOUNT] = {0};
struct coingroup coins[COINGROUPCOUNT] = {
- {{80,305},32,collected_coins}
+ {{80,305},32,collected_coins, 5},
+
+
+ {{75,305},11,collected_coins+32, 5},
+ {{245,285},10,collected_coins+43,5},
+ {{405,305},11,collected_coins+53,5},
+
+
+ {{40,305},6,collected_coins+64,70},
+ {{80,295},5,collected_coins+70,70},
+
+
+ {{65,305},1,collected_coins+75,5},
+ {{100,285},5,collected_coins+76,6},
+ {{200,255},4,collected_coins+81,5},
+ {{280,225},15,collected_coins+85,5},
+ {{560,405},5,collected_coins+100,6}
};
struct object objects[OBJECTCOUNT] = {
struct stage stages[STAGECOUNT] = {
{"Movement", platforms, 1, dialogues, 7, danger, 0,NULL,0,coins,1},
- {"Jumping", platforms+1, 2, dialogues+7, 1, danger, 0,NULL,0,NULL,0},
- {"Danger", platforms+3, 1, dialogues+8, 1, danger, 4,NULL,0,NULL,0},
- {"(level)", platforms+4, 5, NULL,0,danger+4,1,NULL,0,NULL,0},
+ {"Jumping", platforms+1, 2, dialogues+7, 1, danger, 0,NULL,0,coins+1,3},
+ {"Danger", platforms+3, 1, dialogues+8, 1, danger, 4,NULL,0,coins+4,2},
+ {"(level)", platforms+4, 5, NULL,0,danger+4,1,NULL,0,coins+6,5},
{"Wall-jumping", platforms+9, 3,dialogues+9,1,danger,0,NULL,0,NULL,0},
{"(level)", platforms+12, 7, NULL,0,danger+5,4,NULL,0,NULL,0},
{"Interact", platforms+19,4, dialogues+10,3,danger+9,3,objects,1,NULL,0},