Skip to content

Commit

Permalink
Preparación para github
Browse files Browse the repository at this point in the history
Se han hecho las preparaciones finales para subir el código a
github. Los cambios incluyen lo siguiente:
- Se agregó la licencia Unlicense a todos los archivos de código
- Se agregaron comentarios al archivo de la fuente Zilla Slab para
  indicar que la fuente está bajo la licencia SIL OFT.
- Se agregaron los archivos de Markdown para github junto con su
  respectiva carpeta data para las imágenes.
- Lo más importante, se copió el archivo game.h al repositorio
  permitiendo que por primera vez el código se pueda compilar de
  forma independiente. Todas las versiones anteriores a este
  commit se pueden compilar pero requerirán cambios menores a los
  archivos game.h y CMakeLists.txt.

Con estos cambios, el código está finalmente listo para subirlo a
github.
  • Loading branch information
monstruosoft committed Mar 7, 2019
1 parent 7ae00e0 commit 25ac5a3
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 5 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ IF (WANT_DEBUG)
ADD_DEFINITIONS(-DDEBUG)
ENDIF (WANT_DEBUG)

IF (NOT DEFINED UTILS_DIR)
MESSAGE(FATAL_ERROR "'UTILS_DIR' Not defined")
ENDIF (NOT DEFINED UTILS_DIR)

INCLUDE_DIRECTORIES (${ALLEGRO5_INCLUDE_DIRS} ${BASE_DIRECTORY}/include ${UTILS_DIR}/include)
INCLUDE_DIRECTORIES (${ALLEGRO5_INCLUDE_DIRS} ${BASE_DIRECTORY}/include)
LINK_DIRECTORIES (${ALLEGRO5_LIBRARY_DIRS})

ADD_EXECUTABLE (main ${SOURCE_DIR}/main.c ${SOURCE_DIR}/monstrominas.c ${SOURCE_DIR}/support.c)
Expand Down
32 changes: 32 additions & 0 deletions LEEME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:octocat::octocat::octocat: To read the english version of this document [click here](./README.md). :octocat::octocat::octocat:

[![monstrochan](./data/monstrochan.png)](http://monstrochan.org/l/)
- - -
# monstrominas
#### *monstrominas* por *monstruosoft* por *monstrochan*

*monstrominas* es un clón de Buscaminas escrito para el Reto de la toja azul 2019 en [monstrochan.org](http://monstrochan.org/l/).

![monstrominas](./data/monstrominas.png)

- - -
## Características
* Imagen de fondo.
* Tamaño interactivo (usa la rueda del mouse).

## Compilar
En **Linux**, el archivo `CMakeLists.txt` incluído debería ser suficiente para compilar el proyecto si se encuentran instaladas las librerías requeridas.

* Asegúrate de tener los siguientes paquetes instalados:
* **CMake**
* **Allegro 5** versión para desarrolladores
* Crea una carpeta con el nombre *build* dentro de la carpeta del proyecto y compila usando *CMake + make*:
```
monstruosoft@PC:~$ cd monstrominas
monstruosoft@PC:~/monstrominas$ mkdir build
monstruosoft@PC:~/monstrominas$ cd build
monstruosoft@PC:~/monstrominas/build$ cmake ..
monstruosoft@PC:~/monstrominas/build$ make
```

En **Windows** debería ser posible compilar el juego usando *CMake y MinGW* pero buena suerte con eso ya que yo no puedo probar a compilarlo en Windows.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:octocat::octocat::octocat: Para leer la versión en español de este documento [haz click aquí](./LEEME.md). :octocat::octocat::octocat:

[![monstrochan](./data/monstrochan.png)](http://monstrochan.org/l/)
- - -
# monstrominas
#### *monstrominas* by *monstruosoft* by *monstrochan*

*monstrominas* is a Minesweeper clone written for the "Reto de la toja azul 2019" challenge at [monstrochan.org](http://monstrochan.org/l/).

![monstrominas](./data/monstrominas.png)

- - -
## Features
* Background image (because, why not?).
* Interactive minefield size (use mouse wheel).

## Building
On **Linux**, the included `CMakeLists.txt` should build the project given that the necessary libraries are installed on your system.

* Make sure you have the required packages installed:
* **CMake**
* **Allegro 5** development files
* Create a *build* directory inside the project directory and build it using *CMake + make*:
```
monstruosoft@PC:~$ cd monstrominas
monstruosoft@PC:~/monstrominas$ mkdir build
monstruosoft@PC:~/monstrominas$ cd build
monstruosoft@PC:~/monstrominas/build$ cmake ..
monstruosoft@PC:~/monstrominas/build$ make
```

On **Windows**, you should be able to build the game using *CMake + MinGW*. Good luck with that, though, since I can't test the build process on Windows.
24 changes: 24 additions & 0 deletions UNLICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>
Binary file added data/monstrochan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/monstrominas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions include/game.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
* @file game.h
*
* @section LICENSE License
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <https://unlicense.org>
*
* @section DESCRIPTION Description
*
* This is an early implementation of isolated game logic by monstruosoft.
* This filedefines basic typedefs and function prototypes.
*/

// Game mode flags to be applied by select_game_mode()
#define GM_DISABLE_KEYBOARD_INPUT 1
#define GM_DISABLE_MOUSE_INPUT 2
#define GM_ENABLE_KEYBOARD_INPUT 4
#define GM_ENABLE_MOUSE_INPUT 8



enum {GM_GAME, GM_WIN}; // Game modes



typedef struct GAME_ACTOR {
int x;
int y;
int age;
int state;
bool active;
bool visible;
void *data;
void (*control) ();
void (*logic) ();
void (*draw) ();
void (*print) ();
void (*destroy)();
} GAME_ACTOR;



void select_game_mode(int mode, int flags);

// void game_logic(ALLEGRO_EVENT *event);
// void game_update();

// void win_logic(ALLEGRO_EVENT *event);
// void win_update();



GAME_ACTOR *game_actor_create(); // Create a dummy game actor instance
void game_actor_print(GAME_ACTOR *actor);
void game_actor_draw(GAME_ACTOR *actor);
void game_actor_logic(GAME_ACTOR *actor, ALLEGRO_EVENT *event);
void game_actor_destroy(GAME_ACTOR *actor);

35 changes: 35 additions & 0 deletions include/monstrominas.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
/**
* @file monstrominas.h
*
* @section LICENSE License
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <https://unlicense.org>
*
* @section DESCRIPTION Description
*
* Typedefs and function prototypes for monstrominas minesweeper.
*/

#define MINESWEEPER_ROWS 10
#define MINESWEEPER_COLUMNS 10
#define MINESWEEPER_MINES 85
Expand Down
9 changes: 9 additions & 0 deletions include/resources_font.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* This is a header file representation of the file ZillaSlab-Bold.ttf
* part of Mozilla's Zilla Slab type family.
*
* https://github.com/mozilla/zilla-slab
*
* The Zilla Slab font is distributed under the SIL Open Font License.
*/

unsigned char ZillaSlab_Bold_ttf[] = {
0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00,
0x47, 0x50, 0x4f, 0x53, 0x36, 0x41, 0xe5, 0xb0, 0x00, 0x00, 0x01, 0x0c,
Expand Down
35 changes: 35 additions & 0 deletions src/monstrominas.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
/**
* @file monstrominas.c
*
* @section LICENSE License
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <https://unlicense.org>
*
* @section DESCRIPTION Description
*
* Minesweeper logic.
*/

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
Expand Down

0 comments on commit 25ac5a3

Please sign in to comment.