本文实例为大家分享了Python写超级马里奥的具体代码,供大家参考,具体内容如下
完整代码和素材戳我
主代码
import pygame as pg
from source.main import main
if __name__=="__main__":
main()
pg.quit()
main
__author__ = "marble_xu"
import pygame as pg
from . import setup, tools
from . import constants as c
from .states import main_menu, load_screen, level
def main():
game = tools.Control()
state_dict = {c.MAIN_MENU: main_menu.Menu(),
c.LOAD_SCREEN: load_screen.LoadScreen(),
c.LEVEL: level.Level(),
c.GAME_OVER: load_screen.GameOver(),
c.TIME_OUT: load_screen.TimeOut()}
game.setup_states(state_dict, c.MAIN_MENU)
game.main()
setup
__author__ = "marble_xu"
import os
import pygame as pg
from . import constants a