-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
58 lines (44 loc) · 1.29 KB
/
main.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'''
Runs the main game loop.
'''
import pygame
from controllers import DgController, FpController
from game import Game
from platforms import Platforms
from players import DgPlayer, FpPlayer
from views import DgView, FpView
def main():
'''
Runs the dress up and then platformer game.
'''
# define game class
game = Game()
# define dressup game classes
dg_player = DgPlayer()
dg_controller = DgController(game, dg_player)
dg_view = DgView(game, dg_player)
# define platformer classes
fp_player = FpPlayer(game)
fp_controller = FpController(game, fp_player)
platforms = Platforms(game)
fp_view = FpView(game, fp_player, platforms)
while game.running:
game.update()
if game.game_state == "dressup":
dg_controller.change_clothes()
dg_view.draw_bg()
dg_view.draw_instructions()
dg_view.draw_clothes()
dg_view.draw_arrows()
dg_view.update()
else:
fp_view.draw_bg()
fp_view.draw_player()
fp_view.draw_platforms()
fp_controller.move_player()
fp_player.update_pos(platforms.group)
platforms.generate()
platforms.scroll()
fp_view.update()
pygame.quit()
main()