summaryrefslogtreecommitdiffstats
path: root/Geometry-Dash/main.py
blob: 0207b12db6d66cb725f869ee6eaddf9ca1e1e522 (plain)
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
from setup import *
from colors import COLOR_AQUA
from game import Game
from splash import Splash

is_running = True

dimensions = (SCREEN_WIDTH, SCREEN_HEIGHT)
screen = pygame.display.set_mode(dimensions)

pygame.display.set_caption("Geometry Dash")
logo = pygame.image.load('textures/logo.png')
pygame.display.set_icon(logo)

current_scene = Splash()

previous_time = pygame.time.get_ticks()

while is_running:
    current_time = pygame.time.get_ticks()
    delta_time = current_time - previous_time
    previous_time = current_time

    screen.fill(COLOR_AQUA)

    status = current_scene.update(delta_time)
    current_scene.draw(screen)

    if status == COMMAND_EXIT:
        is_running = False
    elif status == COMMAND_START:
        current_scene = Game()

    pygame.display.update()

pygame.quit()