-
Notifications
You must be signed in to change notification settings - Fork 0
/
environmentAddons.py
39 lines (35 loc) · 1.08 KB
/
environmentAddons.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
39
import pygame
from pygame.locals import *
from numpy import loadtxt
#intervalx is the width between each character in a row
#intervaly is the height between each character in a column
#intervalx=
#intervaly=
#below is the radius of the dot
radius= 2
count= 0
pygame.init()
screen = pygame.display.set_mode((1200,600))
width, height = (32, 32)
squares = []
circles= []
rows, columns = layout.shape
for col in range(columns):
for row in range(rows):
value = layout[row][col]
if value == '%':
pos = (columns*width, row*height)
Square= pygame.draw.rect(pos, intervalx, intervaly)
squares.append(Square)
elif value == ' . '
pos2= (columns*width, row*height)
Dot= pygame.draw.circle(screen, (227,207,87), pos2, radius)
circles.append(Dot)
while True:
for Dot in circles:
if xpos==pos2:
count+=1
circles.remove(Dot)
if count== circles.length()-1:
current_room_number+=1
current_room=rooms[current_room_number]