]> _ Git - aichan-platformer.git/commitdiff
new levels! (next: interactable objects)
authorparking_turkeys <roya1060wien@gmail.com>
Wed, 22 Jul 2026 22:16:06 +0000 (18:16 -0400)
committerparking_turkeys <roya1060wien@gmail.com>
Wed, 22 Jul 2026 22:16:06 +0000 (18:16 -0400)
level.c
level_data.h
main_v2.c
physics.c

diff --git a/level.c b/level.c
index fef2f58..76d2bee 100644 (file)
--- a/level.c
+++ b/level.c
@@ -35,6 +35,9 @@ int bühnezeichnen(void)
        }
 
        if (frozen) { //currently in dialogue
+               if (stages[level].dialogues == NULL) {
+                       frozen = 0;
+               } else {
                drawdialogue();
                if (IsKeyPressed(ADVANCEKEY)) {
                        if (++current_dialogue == stages[level].dialogue_count) { //dialogue over
@@ -42,6 +45,7 @@ int bühnezeichnen(void)
                                frozen = 0;
                        }
                }
+               }
        };
 
        return 1;
index 6b84bad..31ae70b 100644 (file)
@@ -1,9 +1,10 @@
-#define STAGECOUNT 5
-#define DIALOGUECOUNT 11
-#define PLATFORMCOUNT 12
-#define DANGERCOUNT 5
+#define STAGECOUNT 7
+#define DIALOGUECOUNT 14
+#define PLATFORMCOUNT 23
+#define DANGERCOUNT 12
 
 #include "game.h"
+#include <stddef.h>
 
 //icons are 40x40
 
@@ -24,6 +25,13 @@ struct dialogue dialogues[DIALOGUECOUNT] = {
 
 
        {"To wall-jump, slide on a wall and press the JUMP key.", "Ai-chan", "dialogue-img/aichan-smile.png", GREEN},
+
+
+       {"Huh? Is that Sin Mal over there?", "Ai-chan", "dialogue-img/aichan-neutral.png", GREEN},
+       {"Well... we should say hi to her. (Press R to INTERACT)", "Ai-chan", "dialogue-img/aichan-smile.png", GREEN},
+       {"This level may seem impossible but it is in fact possible.", "Context", "dialogue-img/aichan-default.png", BLACK},
+
+
        {"YOU WIN!!", "Ai-chan", "dialogue-img/aichan-smile.png", GREEN}
 };
 
@@ -47,7 +55,23 @@ struct platform platforms[PLATFORMCOUNT] = {
 
        {{0,320,640,160},GREEN},
        {{400,80,80,200}, GREEN},
-       {{540,100,100,200},GREEN}
+       {{540,100,100,220},GREEN},
+
+
+       {{0,400,170,80},GREEN},
+       {{240,320,80,160},GREEN},
+       {{100,290,80,80},GREEN},
+       {{340,300,60,20},GREEN},
+       {{440,320,60,20},GREEN},
+       {{520,350,20,20},GREEN},
+       {{560,410,80,70},GREEN},
+
+
+       {{0,440,640,40},GREEN},
+       {{320,320,10,100},GREEN},
+       {{390,320,10,120},GREEN},
+       {{390,320,160,10},GREEN}
+
 };
 
 struct platform danger[DANGERCOUNT] = {
@@ -57,13 +81,26 @@ struct platform danger[DANGERCOUNT] = {
        {{320,310,7,10}, RED},
 
        
-       {{80,440,480,40}, RED}
+       {{80,440,480,40}, RED},
+
+
+       {{170,460,80,20},RED},
+       {{100,270,80,20},RED},
+       {{320,460,240,20},RED},
+       {{460,350,60,20},RED},
+
+
+       {{150,430,20,10},RED},
+       {{420,310,10,10},RED},
+       {{500,310,20,10},RED}
 };
 
 struct stage stages[STAGECOUNT] = {
        {"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},
-       {"Wall-jumping", platforms+9, 3,dialogues+9,1,danger,0}
+       {"(level)", platforms+4, 5, NULL,0,danger+4,1},
+       {"Wall-jumping", platforms+9, 3,dialogues+9,1,danger,0},
+       {"(level)", platforms+12, 7, NULL,0,danger+5,4},
+       {"Interact", platforms+19,4, dialogues+10,3,danger+9,3}
 };     
index 25726ad..cf7ec85 100644 (file)
--- a/main_v2.c
+++ b/main_v2.c
@@ -10,7 +10,7 @@
 #include <math.h>
 #include <stdio.h> // seems useful
 
-int level = 4;
+int level = 6;
 int frozen = 0;
 
 int main(void)
index 851e304..170a836 100644 (file)
--- a/physics.c
+++ b/physics.c
@@ -13,6 +13,9 @@ int physics(float delta, struct character *player)
        if (player->rect.x > SCREENWIDTH) { 
                next_level(player);
                };
+       if (player->rect.x < -1) {
+               kill_chara(player);
+       };
        return 1;
 }