diff --git a/abbaye.desktop b/abbaye.desktop new file mode 100644 index 0000000..a0b2c74 --- /dev/null +++ b/abbaye.desktop @@ -0,0 +1,18 @@ + +[Desktop Entry] +Name=Abbaye des Morts +Name[ca]=Abbaye des Morts +Name[en_GB]=Abbaye des Morts +Name[es]=Abbaye des Morts +Comment=Indie platform game by Locomalito +Comment[ca]=Joc indie de plataformes de Locomalito +Comment[en_GB]=Indie platform game by Locomalito +Comment[es]=Juego indie de plataformas de Locomalito +Exec=abbaye +Icon=abbaye +Terminal=false +Type=Application +Categories=Game;ActionGame; +StartupNotify=false +Version=1.0 +X-Desktop-File-Install-Version=0.19 diff --git a/abbaye.png b/abbaye.png new file mode 100644 index 0000000..fbf092a Binary files /dev/null and b/abbaye.png differ diff --git a/graphics/intro.png b/graphics/intro.png new file mode 100644 index 0000000..6acdc80 Binary files /dev/null and b/graphics/intro.png differ diff --git a/graphics/intromd.png b/graphics/intromd.png new file mode 100644 index 0000000..3bf4b93 Binary files /dev/null and b/graphics/intromd.png differ diff --git a/graphics/tiles.png b/graphics/tiles.png new file mode 100644 index 0000000..85295cc Binary files /dev/null and b/graphics/tiles.png differ diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..86ed187 --- /dev/null +++ b/src/main.c @@ -0,0 +1,44 @@ +/* Abbaye des Morts */ +/* Version 2.0 */ + +/* (c) 2010 - Locomalito & Gryzor87 */ +/* 2013 - David "Nevat" Lara */ + +/* GPL v3 license */ + +main () { + + uint exit = 0; + uint state = 0; /* 0-intro,1-introduction */ + uint grapset = 0; /* 0-8bits, 1-16bits */ + + /* Creating window */ + SDL_Window *screen = SDL_CreateWindow("Abbaye des Morts v2.0",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,512,384,SDL_WINDOW_OPENGL); + /* Renderer (with VSync, nice !) */ + SDL_Renderer *renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_PRESENTVSYNC); + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); // make the scaled rendering look smoother. + SDL_RenderSetLogicalSize(renderer, 256, 192); + + while (exit != 1) { + switch (state) { + case 0: startscreen(screen,renderer,&state,&grapset); + break; + case 1: exit = 1; + break; + } + } + + /* Cleaning */ + SDL_DestroyRenderer(renderer); + SDL_DestroyWindow(screen); + + /* Exiting normally */ + return 0; + +} + +void history(SDL_Renderer *renderer,uint *state,uint *grapset) { + + uint exit = 0; + +} \ No newline at end of file diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..8cf8228 --- /dev/null +++ b/src/main.h @@ -0,0 +1,6 @@ +/* main.h */ + +# include +# include +# include "SDL2/SDL.h" +# include "SDL2/SDL_image.h" \ No newline at end of file diff --git a/src/startscreen.c b/src/startscreen.c new file mode 100644 index 0000000..9d948a7 --- /dev/null +++ b/src/startscreen.c @@ -0,0 +1,62 @@ +/* startscreen.c */ + +# include "startscreen.h"; + +void startscreen(SDL_Window *screen,SDL_Renderer *renderer,uint *state,uint *grapset) { + + int exit = 0; + + SDL_Rect srcintro = {0,0,256,192}; + SDL_Rect desintro = {0,0,256,192}; + + SDL_Event keyp; + + /* Loading PNG */ + SDL_Texture *intro = IMG_LoadTexture(renderer,"../graphics/intro.png"); + SDL_Texture *intromd = IMG_LoadTexture(renderer,"../graphics/intromd.png"); + + while (exit != 1) { + + /* Cleaning the renderer */ + SDL_RenderClear(renderer); + + /* Put image on renderer */ + if (*grapset == 0) + SDL_RenderCopy(renderer, intro, &srcintro, &desintro); + else + SDL_RenderCopy(renderer, intromd, &srcintro, &desintro); + + /* Flip ! */ + SDL_RenderPresent(renderer); + + /* Check keyboard */ + if ( SDL_PollEvent(&keyp) ) { + if (keyp.type == SDL_KEYDOWN) { /* Key pressed */ + if (keyp.key.keysym.sym == SDLK_c) { /* Change graphic set */ + if (*grapset == 0) + *grapset = 1; + else + *grapset = 0; + } + if (keyp.key.keysym.sym == SDLK_i) { /* Show instructions */ + if (srcintro.y == 0) + srcintro.y = 192; + else + srcintro.y = 0; + } + if (keyp.key.keysym.sym == SDLK_f) /* Switch to fullscreen */ + SDL_SetWindowFullscreen(screen,SDL_WINDOW_FULLSCREEN); + if (keyp.key.keysym.sym == SDLK_SPACE) { /* Start game */ + *state = 1; + exit = 1; + } + } + } + + } + + /* Cleaning */ + SDL_DestroyTexture(intro); + SDL_DestroyTexture(intromd); + +} \ No newline at end of file diff --git a/src/startscreen.h b/src/startscreen.h new file mode 100644 index 0000000..f334765 --- /dev/null +++ b/src/startscreen.h @@ -0,0 +1,6 @@ +/* startscreen.h */ + +# include +# include +# include "SDL2/SDL.h" +# include "SDL2/SDL_image.h" \ No newline at end of file