From: parking_turkeys Date: Mon, 13 Jul 2026 03:15:27 +0000 (-0400) Subject: I MANAGED TO PUT AN IMAGE ON THERE?? woah... X-Git-Tag: broken~10 X-Git-Url: http://git.parking-turkeys.net/?a=commitdiff_plain;h=c19e83f059c5047a89a19088fdea0e856e7c541e;p=aichan-platformer.git I MANAGED TO PUT AN IMAGE ON THERE?? woah... --- diff --git a/game.h b/game.h index 76fcfd3..0290a41 100644 --- 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 diff --git a/main_v2.c b/main_v2.c index caae364..659dd18 100644 --- a/main_v2.c +++ b/main_v2.c @@ -12,12 +12,15 @@ 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 +} diff --git a/player.c b/player.c index f087ed0..1243b02 100644 --- a/player.c +++ b/player.c @@ -2,9 +2,26 @@ #include #include #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; } + +