player.velocity.y = 0;
move_x(&player, direction.x);
move_y(&player, direction.y);
- if (injump = -1) {gravity(&player, ground, ground_length);} else { injump += GetFrameTime(); player.position.y = jumpstart + powf(injump, 2) * 16 + 2 * injump;
+ if (injump = -1) {gravity(&player, ground, ground_length);} else { injump += GetFrameTime(); player.position.y = jumpstart + powf(injump, 2) * 16 + 2 * injump;}
//set position
move_character(&player, ground, ground_length, GetFrameTime());
//player.position.y += 1;
direction.x++;
}; if (IsKeyDown(inputs[4])) {
injump = 0;
- jumpstart = player->position.y
+ jumpstart = player->position.y;
}
return direction;
}
--- /dev/null
+// THIS TIME I WILL PLAN THIS OUT
+// OKAY SO UHHHH IDK HOW TO DO THIS LMFAO
+// MAYBE a seperate file? for the player??
+// oh first
+#include "raylib.h"
+// wait arent you supposed to make a file with h in it or smth
+// i have no idea how to use C btw
+// ok yeah that's to link all the other files together
+#include "game.h" // remember to make this
+#include <math.h>
+#include <stdio.h> // seems useful
+
+int main(void)
+{
+ InitWindow(SCREENWIDTH, SCREENHEIGHT, WINDOWTITLE);
+ SetTargetFPS(FPS);
+
+ while (!WindowShouldClose()) {
+ //update variables
+
+ BeginDrawing();
+ drawstage();
+ drawplayer();
+ EndDrawing();
+ }
+
+ CloseWindow();
+
+ return 0;
+}