+#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
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();
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
+}
#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;
}
+
+