commit
This commit is contained in:
parent
0b181013ed
commit
40871f7cd5
1 changed files with 4 additions and 6 deletions
10
main.py
10
main.py
|
@ -2,8 +2,8 @@ from tkinter import *
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
WIDTH = 900
|
WIDTH = 1400
|
||||||
HEIGHT = 600
|
HEIGHT = 800
|
||||||
|
|
||||||
class Planet:
|
class Planet:
|
||||||
def __init__(self, canvas, size, mass, color, x, y):
|
def __init__(self, canvas, size, mass, color, x, y):
|
||||||
|
@ -96,8 +96,6 @@ class System():
|
||||||
def main():
|
def main():
|
||||||
window = Tk()
|
window = Tk()
|
||||||
|
|
||||||
fps_limit = 75
|
|
||||||
|
|
||||||
canvas = Canvas(window, bg="black", width=WIDTH, height=HEIGHT)
|
canvas = Canvas(window, bg="black", width=WIDTH, height=HEIGHT)
|
||||||
canvas.pack()
|
canvas.pack()
|
||||||
|
|
||||||
|
@ -126,10 +124,10 @@ def main():
|
||||||
blue_moon.orbit(earth)
|
blue_moon.orbit(earth)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
system.update_all(time.get() / fps_limit, scale.get())
|
system.update_all(time.get() / fps.get(), scale.get())
|
||||||
window.update_idletasks()
|
window.update_idletasks()
|
||||||
window.update()
|
window.update()
|
||||||
sleep(1 / fps_limit)
|
sleep(1 / fps.get())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue