我的游戏就像汽车从上方驶来,玩家必须通过向左或向右移动来躲避它
(x,y)
是玩家的位置(enemy_startx,enemy_starty)
是敌人的立场其他变量显而易见
#These are also the crash conditions for the game.
if y < enemy_starty+enemy_height:
if x > enemy_startx and x < enemy_startx + enemy_width or x+(car_width+5) > enemy_startx and x + (car_width+5) < enemy_startx+enemy_width:
crash()
目前没有回答
相关问题 更多 >
编程相关推荐