You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
1.8 KiB
87 lines
1.8 KiB
#include "raylib.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "sprite.h"
|
|
#include "Input/inputHandler.h"
|
|
#include "raymath.h"
|
|
#include "List/list.h"
|
|
#include "IsometricMap/isometricRenderer.h"
|
|
#include "IsometricMap/isometricMap.h"
|
|
#include "game.h"
|
|
#include "DepthSorting/bucket.h"
|
|
#include "DepthSorting/mergeSort.h"
|
|
|
|
int main(){
|
|
|
|
InitWindow(800, 450, "basic window");
|
|
|
|
//Texture2D amulet = LoadTexture("assets/amulet.png");
|
|
Game *game = GameInit();
|
|
|
|
// Hides the operating systems own cursor
|
|
HideCursor();
|
|
|
|
SetTargetFPS(60);
|
|
|
|
/*
|
|
Bucket *buckets[10];
|
|
int i = 0;
|
|
for(i = 9; i >= 0; i--){
|
|
buckets[9-i] = (BucketInit(0, game->layers[0]->tiles[i][i]));
|
|
}
|
|
printf("\n");
|
|
for(i = 0; i < 10; i++){
|
|
printf("%f\n", buckets[i]->depth);
|
|
}
|
|
printf("\n");
|
|
MergeSort(buckets, 10);
|
|
printf("\n");
|
|
for(i = 0; i < 10; i++){
|
|
printf("%f\n", buckets[i]->depth);
|
|
}
|
|
printf("\n");
|
|
*/
|
|
|
|
// GAME MAIN ROUTINE
|
|
while(!WindowShouldClose()){
|
|
|
|
ListActAllSprites(game);
|
|
|
|
ClearBackground(RAYWHITE);
|
|
BeginDrawing();
|
|
|
|
BeginMode2D(*(game->camera));
|
|
|
|
//IsometricRendererRenderIsometricMap(game);
|
|
//ListDrawAllSprites(game->sprites, game->layers, game->camera);
|
|
IsometricMapDraw(game);
|
|
|
|
EndMode2D();
|
|
|
|
// Moving cursor Sprite to Mouse Pos and drawing it
|
|
game->cursorSprite->x = game->inputHandler->cursorPos.x;
|
|
game->cursorSprite->y = game->inputHandler->cursorPos.y;
|
|
DrawSpriteToScreen(game->cursorSprite);
|
|
|
|
// User Input Handling
|
|
mouseInput(game);
|
|
keyboardInput(game->inputHandler, game->camera);
|
|
|
|
DrawFPS(GetScreenWidth() - 95, 10);
|
|
|
|
EndDrawing();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
CloseWindow();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|