]> _ Git - aichan-platformer.git/commitdiff
I MANAGED TO PUT AN IMAGE ON THERE?? woah...
authorparking_turkeys <roya1060wien@gmail.com>
Mon, 13 Jul 2026 03:15:27 +0000 (23:15 -0400)
committerparking_turkeys <roya1060wien@gmail.com>
Mon, 13 Jul 2026 03:15:27 +0000 (23:15 -0400)
game.h
main_v2.c
player.c

diff --git a/game.h b/game.h
index 76fcfd3..0290a41 100644 (file)
--- a/game.h
+++ b/game.h
@@ -1,11 +1,53 @@
+#include "raylib.h"
+
 #define SCREENWIDTH 640
 #define SCREENHEIGHT 480
 #define FPS 30
 #define WINDOWTITEL "platformer v2 (it works this time) (not really)"
+
+#define ICONPATH "icon.png"
+
 #define ZeichnenAnfangen() BeginDrawing()
 #define ZeichnenAufhören() EndDrawing()
 
+#define SPEED 240
+#define GRAVITY 320
+
+int spielersetup(void);
+
 int bühnezeichnen(void); //i dont think stage works here but it seems better than window
 int spielerzeichnen(void);
 
+int variables(float delta);
+int spieler_bewegen(float delta);
+int on_floor(struct Rectangle rect);
+
+
+//structures
+struct character {
+       struct Rectangle rect;
+       struct Vector2 velocity;
+};
+
+struct platform {
+       struct Rectangle rect;
+       Color colour;
+
+};
+
+struct dialogue {
+       char *line;
+       char *charaname;
+       char *image;
+       Color characolour;
+};
+
+struct stage {
+       char *name;
+       struct platform *platforms;
+       int platform_count;
+       struct dialogue *dialogues;
+       int dialogue_count;
+};
 
+//variables
index caae364..659dd18 100644 (file)
--- a/main_v2.c
+++ b/main_v2.c
 
 int main(void)
 {
-       InitWindow(SCREENWIDTH, SCREENHEIGHT, WINDOWTITLE);
+       InitWindow(SCREENWIDTH, SCREENHEIGHT, WINDOWTITEL);
+       SetWindowIcon(LoadImage(ICONPATH));
        SetTargetFPS(FPS);
+       
+       spielersetup();
 
        while (!WindowShouldClose()) {
-               //update variables
-
+               //variables.
+               variables(GetFrameTime());
                ZeichnenAnfangen();
                        bühnezeichnen();
                        spielerzeichnen();
@@ -28,3 +31,10 @@ int main(void)
 
        return 0;
 }
+
+int variables(float delta)
+{
+       //hier sollten dann die variables (??) aktualisiert werden (aber nichts solltet schon gezeichnet werden)
+       spieler_bewegen(delta); //.... ich habe vergessen wie man deutsch redet haha
+       return 1; // :p
+}
index f087ed0..1243b02 100644 (file)
--- a/player.c
+++ b/player.c
@@ -2,9 +2,26 @@
 #include <stdio.h>
 #include <math.h>
 #include "game.h"
+struct character player = {{310,220,15,18},{0,0}};
+int inputs[3] = {KEY_A,KEY_D,KEY_H}; //left, right, jump/advance dialogue
+Image front_sheet;
+Texture2D front_single;
 
+int spielersetup(void)
+{
+       front_single = LoadTextureFromImage(LoadImage("aichan-front.png"));
+
+       front_sheet = LoadImage("aichan-front-sheet.png");
+}
 
 int spielerzeichnen(void)
+{
+       DrawTexture(front_single, player.rect.x, player.rect.y, WHITE);
+}
+
+int spieler_bewegen(float delta)
 {
        return 1;
 }
+
+