diff --git a/main.py b/main.py index 4cd4b2c..5ec51d6 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ # libraries import pygame +from pyglet.gl import * # for blocky textures # other files of this project import project_constants @@ -13,6 +14,10 @@ if __name__ == "__main__": pygame.init() pygame.display.set_caption(project_constants.V_NAME_OF_WINDOW) + # for blocky textures + glEnable(GL_TEXTURE_2D) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) + # loading minefields # TODO : call to a minefield loading function goes here diff --git a/project_constants.py b/project_constants.py index 43f6b2b..c2af97c 100644 --- a/project_constants.py +++ b/project_constants.py @@ -1,10 +1,16 @@ import pygame + # VARIABLE STARTS WITH ... IF IT'S # V a value like a string or an int # ASSET a png file (or other graphic format) + +# ================= # +# === VARIABLES === # +# ================= # + V_NAME_OF_WINDOW = "MineFusion TM" @@ -16,8 +22,90 @@ SCREEN = pygame.display.set_mode\ ( ( V_TILE_SIZE * V_GRID_HOR_TILES + 2 * V_SCREEN_PADDING, # screen width - V_TILE_SIZE * V_GRID_HOR_TILES + 2 * V_SCREEN_PADDING # screen height + V_TILE_SIZE * V_GRID_HOR_TILES + 2 * V_SCREEN_PADDING # screen height ) ) -ASSET_BACKGROUND = pygame.image.load('resources/assets/grid.png') + + +# ============== # +# === ASSETS === # +# ============== # + +ASSET_BACKGROUND = pygame.transform.scale\ +( + pygame.image.load('resources/assets/new_grid.png'), + ( 600, 600 ) +) + +ASSET_SAPPER = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/sapper.png' ), + ( 60, 60 ) +) + +ASSET_MINE_A = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/mine_a.png' ), + ( 60, 60 ) +) + +ASSET_MINE_B = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/mine_b.png' ), + ( 60, 60 ) +) + +ASSET_MINE_F = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/mine_f.png' ), + ( 60, 60 ) +) + +ASSET_MINE_K = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/mine_k.png' ), + ( 60, 60 ) +) + +ASSET_TILE_ORANGE = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_orange.png' ), + ( 60, 60 ) +) + +ASSET_TILE_RED = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_red.png' ), + ( 60, 60 ) +) + +ASSET_TILE_BLUE = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_blue.png' ), + ( 60, 60 ) +) + +ASSET_TILE_PURPLE = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_purple.png' ), + ( 60, 60 ) +) + +ASSET_TILE_GREEN = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_green.png' ), + ( 60, 60 ) +) + +ASSET_TILE_YELLOW = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_yellow.png' ), + ( 60, 60 ) +) + +ASSET_TILE_WHITE = pygame.transform.scale\ +( + pygame.image.load( 'resources/assets/tile_white.png' ), + ( 60, 60 ) +) \ No newline at end of file diff --git a/resources/assets/mine_a.png b/resources/assets/mine_a.png new file mode 100644 index 0000000..abdeaed Binary files /dev/null and b/resources/assets/mine_a.png differ diff --git a/resources/assets/mine_b.png b/resources/assets/mine_b.png new file mode 100644 index 0000000..3b0ed78 Binary files /dev/null and b/resources/assets/mine_b.png differ diff --git a/resources/assets/mine_f.png b/resources/assets/mine_f.png new file mode 100644 index 0000000..6fe8636 Binary files /dev/null and b/resources/assets/mine_f.png differ diff --git a/resources/assets/mine_k.png b/resources/assets/mine_k.png new file mode 100644 index 0000000..ee9c46d Binary files /dev/null and b/resources/assets/mine_k.png differ diff --git a/resources/assets/new_grid.png b/resources/assets/new_grid.png new file mode 100644 index 0000000..2585d54 Binary files /dev/null and b/resources/assets/new_grid.png differ diff --git a/resources/assets/romb.png b/resources/assets/romb.png new file mode 100644 index 0000000..ba61061 Binary files /dev/null and b/resources/assets/romb.png differ diff --git a/resources/assets/sapper.png b/resources/assets/sapper.png index ba61061..716e1c4 100644 Binary files a/resources/assets/sapper.png and b/resources/assets/sapper.png differ diff --git a/resources/assets/tile_blue.png b/resources/assets/tile_blue.png new file mode 100644 index 0000000..52d097b Binary files /dev/null and b/resources/assets/tile_blue.png differ diff --git a/resources/assets/tile_green.png b/resources/assets/tile_green.png new file mode 100644 index 0000000..5cb04f2 Binary files /dev/null and b/resources/assets/tile_green.png differ diff --git a/resources/assets/tile_orange.png b/resources/assets/tile_orange.png new file mode 100644 index 0000000..af8101b Binary files /dev/null and b/resources/assets/tile_orange.png differ diff --git a/resources/assets/tile_purple.png b/resources/assets/tile_purple.png new file mode 100644 index 0000000..47aec1b Binary files /dev/null and b/resources/assets/tile_purple.png differ diff --git a/resources/assets/tile_red.png b/resources/assets/tile_red.png new file mode 100644 index 0000000..f6ab811 Binary files /dev/null and b/resources/assets/tile_red.png differ diff --git a/resources/assets/tile_white.png b/resources/assets/tile_white.png new file mode 100644 index 0000000..afa9bee Binary files /dev/null and b/resources/assets/tile_white.png differ diff --git a/resources/assets/tile_yellow.png b/resources/assets/tile_yellow.png new file mode 100644 index 0000000..6f23403 Binary files /dev/null and b/resources/assets/tile_yellow.png differ