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.
63 lines
1.6 KiB
63 lines
1.6 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"
|
|
|
|
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);
|
|
|
|
// GAME MAIN ROUTINE
|
|
while(!WindowShouldClose()){
|
|
|
|
ListActAllSprites(game);
|
|
|
|
ClearBackground(RAYWHITE);
|
|
BeginDrawing();
|
|
|
|
BeginMode2D(*(game->camera));
|
|
|
|
IsometricRendererRenderIsometricMap(game->layers, game->inputHandler);
|
|
|
|
ListDrawAllSprites(game->sprites, game->layers, game->camera);
|
|
|
|
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);
|
|
|
|
//cursor Positions test
|
|
//printf("Cursor Pos: %f %f\n", game->inputHandler->cursorPos.x, game->inputHandler.cursorPos.y)->
|
|
//printf("Cursor World Pos: %f %f\n", game->inputHandler->cursorWorldPos.x, game->inputHandler->cursorWorldPos.y);
|
|
|
|
DrawFPS(GetScreenWidth() - 95, 10);
|
|
|
|
EndDrawing();
|
|
}
|
|
|
|
CloseWindow();
|
|
|
|
return 0;
|
|
|
|
}
|