add getting dir path from os
This commit is contained in:
parent
df796c0842
commit
2775ca1277
35
src/const.py
35
src/const.py
@ -1,35 +1,36 @@
|
|||||||
|
import os
|
||||||
from pygame import image
|
from pygame import image
|
||||||
|
|
||||||
from config import main_path
|
|
||||||
|
|
||||||
|
main_path = os.path.dirname(os.getcwd())
|
||||||
|
|
||||||
WIDTH = 800
|
WIDTH = 800
|
||||||
HEIGHT = 800
|
HEIGHT = 800
|
||||||
|
|
||||||
IMAGES = []
|
IMAGES = []
|
||||||
for img in ['grass_01', 'grass_02', 'grass_mine_01', 'grass_mine_02', 'grass_rock_01','grass_mine_02a','grass_mine_02a',
|
for img in [
|
||||||
'grass_mine_02b','grass_mine_03a','grass_rock_02']:
|
'grass_01',
|
||||||
IMAGES.append(image.load(main_path + 'images/Tiles/' + img + ".png"))
|
'grass_02',
|
||||||
|
'grass_mine_01',
|
||||||
|
'grass_mine_02',
|
||||||
|
'grass_mine_02a',
|
||||||
|
'grass_mine_02a',
|
||||||
|
'grass_mine_02b',
|
||||||
|
'grass_mine_03a',
|
||||||
|
'grass_rock_01',
|
||||||
|
'grass_rock_02',
|
||||||
|
]:
|
||||||
|
IMAGES.append(image.load(main_path + '/images/Tiles/' + img + ".png"))
|
||||||
|
|
||||||
ICON = main_path + 'images/mine_icon.png'
|
ICON = main_path + '/images/mine_icon.png'
|
||||||
SAPPER_IDLE = image.load(main_path + 'images/sapper_idle/cpt_bomba.png')
|
SAPPER_IDLE = image.load(main_path + '/images/sapper_idle/cpt_bomba.png')
|
||||||
|
|
||||||
SAPPER_RUNNING = []
|
SAPPER_RUNNING = []
|
||||||
"""for img in [
|
|
||||||
'sapper_run_01',
|
|
||||||
'sapper_run_02',
|
|
||||||
'sapper_run_03',
|
|
||||||
'sapper_run_04',
|
|
||||||
'sapper_run_05',
|
|
||||||
'sapper_run_06',
|
|
||||||
'sapper_run_07',
|
|
||||||
'sapper_run_08',
|
|
||||||
]:"""
|
|
||||||
for img in [
|
for img in [
|
||||||
'cpt_bomba_left',
|
'cpt_bomba_left',
|
||||||
'cpt_bomba_right',
|
'cpt_bomba_right',
|
||||||
]:
|
]:
|
||||||
SAPPER_RUNNING.append(image.load(main_path + 'images/sapper_idle/' + img + ".png"))
|
SAPPER_RUNNING.append(image.load(main_path + '/images/sapper_idle/' + img + ".png"))
|
||||||
|
|
||||||
DEFAULT_FIELD = [
|
DEFAULT_FIELD = [
|
||||||
[1, 3, 4, 5, 0, 1, 2, 3, 2, 0],
|
[1, 3, 4, 5, 0, 1, 2, 3, 2, 0],
|
||||||
|
Loading…
Reference in New Issue
Block a user