-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMining.py
More file actions
23 lines (23 loc) · 854 Bytes
/
Copy pathMining.py
File metadata and controls
23 lines (23 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from tkinter import *
import time
import random
def Mine(r, chance, speed, color):
root = Toplevel(r)
root.title("GEOLOGICAL SURVEY")
root.resizable(False, False)
#color = '#56341B'
canvas = Canvas(root, background=color, highlightthickness=0)
canvas.pack(fill=BOTH, expand = 1)
root.geometry("300x1" + '+' + str(r.winfo_x() + 100) + '+' + str(r.winfo_y()+530))
root.update()
for i in range(int(750/speed)):
time.sleep(0.001)
root.geometry("300x"+str(int(i*speed)))
spawnMineral = random.randint(0, chance)
if spawnMineral <= 1:
x = random.randint(0, 280)
size = random.randint(2,5)
canvas.create_rectangle(x,int(i*speed),x+size,int(i*speed)+size,fill = "#CFA949", outline = '#CFA949')
root.update()
root.update()
return root