本文整理汇总了Python中Ship.powermax方法的典型用法代码示例。如果您正苦于以下问题:Python Ship.powermax方法的具体用法?Python Ship.powermax怎么用?Python Ship.powermax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ship
的用法示例。
在下文中一共展示了Ship.powermax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Ship [as 别名]
# 或者: from Ship import powermax [as 别名]
#.........这里部分代码省略.........
if sprite.generictype == "Coin":#coins
if sprite.y < -20 or sprite.y > 720 or sprite.x < -20 or sprite.x > 1020:#This conditional removes off-screen coins
allsprites.remove(sprite)
del(sprite)
elif sprite.generictype == "MyWeapon":#weapons
if sprite.y < -20 or sprite.y > 1000:#This conditional checks if a laser is off of the screen and deletes it
allsprites.remove(sprite)
del(sprite)
elif sprite.generictype == "EnemyWeapon":#Draws enemy weapons
if pygame.Rect.colliderect(sprite.hitbox, my_ship.hitbox) == 1:
allsprites.remove(sprite)
my_ship.hp -= sprite.damage
damage0.play()
if my_ship.hp < 0:
my_ship.die()
highscore(hs_table, score)
if sprite.y > 700:
allsprites.remove(sprite)
elif sprite.generictype == "PowerUp":
if sprite.y < -20 or sprite.y > 720 or sprite.x < -20 or sprite.x > 1020:
allsprites.remove(sprite)
del(sprite)
if pygame.Rect.colliderect(sprite.hitbox, my_ship.hitbox) == 1:
power0.play()
my_ship.xpowerup = sprite.name
my_ship.fire_delay = sprite.pow_speed
my_ship.coolantbonus = sprite.coolant
my_ship.powerleft = sprite.duration
my_ship.powermax = sprite.duration
allsprites.remove(sprite)
elif sprite.generictype == "Upgrade":
if sprite.y < -20 or sprite.y > 720 or sprite.x < -20 or sprite.x > 1020:
allsprites.remove(sprite)
del(sprite)
if pygame.Rect.colliderect(sprite.hitbox, my_ship.hitbox) == 1:
power0.play()
if sprite.spectype == "damage0":
my_ship.upgrades[0]=sprite.name
elif sprite.spectype == "backfire":
my_ship.upgrades[1]=sprite.name
allsprites.remove(sprite)
elif sprite.generictype == "Enemy":
if pygame.Rect.colliderect(sprite.hitbox, my_ship.hitbox) == 1:
my_ship.hp -= sprite.hp*5
sprite.hp -= my_ship.hp*5
if sprite.hp < 0:
explosion1.play()
allsprites.remove(sprite)
else:
damage0.play()
try:
crows.remove(sprite)
except:
pass
else:
pass