new assets
5
main.py
@ -1,5 +1,6 @@
|
|||||||
# libraries
|
# libraries
|
||||||
import pygame
|
import pygame
|
||||||
|
from pyglet.gl import * # for blocky textures
|
||||||
|
|
||||||
# other files of this project
|
# other files of this project
|
||||||
import project_constants
|
import project_constants
|
||||||
@ -13,6 +14,10 @@ if __name__ == "__main__":
|
|||||||
pygame.init()
|
pygame.init()
|
||||||
pygame.display.set_caption(project_constants.V_NAME_OF_WINDOW)
|
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
|
# loading minefields
|
||||||
# TODO : call to a minefield loading function goes here
|
# TODO : call to a minefield loading function goes here
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
|
|
||||||
# VARIABLE STARTS WITH ... IF IT'S
|
# VARIABLE STARTS WITH ... IF IT'S
|
||||||
# V a value like a string or an int
|
# V a value like a string or an int
|
||||||
# ASSET a png file (or other graphic format)
|
# ASSET a png file (or other graphic format)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ================= #
|
||||||
|
# === VARIABLES === #
|
||||||
|
# ================= #
|
||||||
|
|
||||||
V_NAME_OF_WINDOW = "MineFusion TM"
|
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 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 )
|
||||||
|
)
|
BIN
resources/assets/mine_a.png
Normal file
After Width: | Height: | Size: 109 B |
BIN
resources/assets/mine_b.png
Normal file
After Width: | Height: | Size: 110 B |
BIN
resources/assets/mine_f.png
Normal file
After Width: | Height: | Size: 108 B |
BIN
resources/assets/mine_k.png
Normal file
After Width: | Height: | Size: 116 B |
BIN
resources/assets/new_grid.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
resources/assets/romb.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 153 B |
BIN
resources/assets/tile_blue.png
Normal file
After Width: | Height: | Size: 82 B |
BIN
resources/assets/tile_green.png
Normal file
After Width: | Height: | Size: 82 B |
BIN
resources/assets/tile_orange.png
Normal file
After Width: | Height: | Size: 82 B |
BIN
resources/assets/tile_purple.png
Normal file
After Width: | Height: | Size: 82 B |
BIN
resources/assets/tile_red.png
Normal file
After Width: | Height: | Size: 82 B |
BIN
resources/assets/tile_white.png
Normal file
After Width: | Height: | Size: 82 B |
BIN
resources/assets/tile_yellow.png
Normal file
After Width: | Height: | Size: 82 B |