forked from Leemoose/Roguelike-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
roguewriting.py
38 lines (31 loc) · 944 Bytes
/
roguewriting.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pygame, random, pygame_gui
import mapping as M
import display as D
import keyboard as K
import loops as L
import warnings
warnings.filterwarnings("ignore")
#..random.seed(420)1
pygame.init()
pygame.font.init()
#Size of tiles
textSize = 32
infoObject = pygame.display.Info()
width = infoObject.current_w #1920 * 4/5
height = infoObject.current_h #1080 * 4/5
textWidth = int(width / textSize)
textHeight = int(height / textSize)
#Haven't used yet
colors = L.ColorDict()
#dictionary mapping renderID to the image
tileDict = M.TileDict(textSize, colors)
#Responsible for game loops
loop = L.Loops(width, height, textSize, tileDict)
display = D.Display(width, height, textSize, textWidth, textHeight)
keyboard = K.Keyboard()
player_turn = True
loop.init_game(display)
loop.change_loop(L.LoopType.main)
while player_turn:
loop.render_screen(keyboard, display, colors, tileDict)
player_turn = loop.action_loop(keyboard, display)