当前位置:   article > 正文

花了我一个晚上时间整理的Python魂斗罗小游戏源代码_github魂斗罗游戏

github魂斗罗游戏

Python魂斗罗小游戏源代码源程序,主程序Contra.py,游戏简易使用说明:A:向左,D:向右,W:跳起,S:趴下,J:射击,P:退出程序。

程序运行截图:

图片

Contra.py

'''公众号:Python代码大全'''import pygameimport sysfrom pygame.locals import *from settings import Settingsfrom game_player import Game_Player import game_functions as gffrom pygame.sprite import Groupfrom game_stats import GameStatsfrom game_boss import Game_Bossfrom button import Button
def run_game():  bg = pygame.image.load("图片/map01.jpeg")  game_settings = Settings()  pos_x = 0#地图移动    pygame.init()  screen = pygame.display.set_mode(    (game_settings.screen_width,game_settings.screen_height))  pygame.display.set_caption("魂斗罗BY Python代码大全")  stats = GameStats(game_settings)  player = Game_Player(game_settings,screen)  bullets = Group()  boss = Group()  enemys = Group()  win_button = Button(game_settings,screen,"YOU WIN")  gf.create_legion(game_settings,screen,enemys)  gf.create_boss(game_settings,screen,player,boss)
  while True:    pygame.mouse.set_visible(False)    gf.check_events(game_settings,screen,player,bullets)    gf.update_player(game_settings,stats,player,enemys)    gf.update_bullet(game_settings,bullets,screen,enemys,boss)      gf.update_enemys(game_settings,enemys)      gf.update_b
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/386297
推荐阅读
相关标签
  

闽ICP备14008679号