Don't say much , Look down !

<> Introduce required modules
from sprites import * from pygame import mixer
<> Format page ( Width, height, etc )
width,height = 800,600 screen = Screen() screen.setup(width,height)
screen.bgcolor('black') screen.title(' Altman hit the monster by Code view home page collar ')
<> Cover role
frames = [f"frames/{i:04d}.png" for i in range(23)] cover = Sprite(shape=frames
)
<> background music
cover.play(' absolute music - Diga Altman theme song .mp3.wav',loop=True) for _ in frames:
cover.nextcostume() cover.wait(0.15) for s in range(10,1,-1): cover.scale(s/100)
cover.right(30) cover.wait(0.01) ultraman = cover ultraman.dead = False
<> main program
explosions = ['res/explosion0.png','res/explosion1.png'] costumes = [
'res/fantasy7.png','res/ghoul-b.png','res/knight1.png', 'res/monster1-a.png',
'res/robot1.png','res/wild1.png','res/witch.png'] monsters = Group('monster') #
Monster group [Sprite(shape=random.choice(costumes),tag='monster',visible=False) for _ in
range(15)] def init_monster(m): x = random.randint(-1000,1000) y =
random.randint(-1000,1000) while ultraman.distance(x,y) < 400: x =
random.randint(-1000,1000) y = random.randint(-1000,1000) m.goto(x,y)
m.movetimes= 0 m.heading(ultraman) m.show() [init_monster(m) for m in monsters]
bullet= Sprite('res/ fire png.png',visible=False) bullet.speed = 0 counter = 0 # Counter
leftkey= Mouse(1) # Left mouse button clock = Clock() success = None # None,False And True
running= True while running: for m in monsters: m.fd(1) # If you hit Altman if m.collide(
ultraman,scale=0.5) and ultraman.dead == False: ultraman.dead = True explode(
m.pos(),explosions) thudsound.play() success = False break init_monster(m) elif
m.collide(bullet): # If the monster hits a bullet counter += 1 screen.title(' Altman hit the monster , Currently killed :' + str(
counter) + " individual ") explode(m.pos(),explosions) thudsound.play() if counter == 100
: # If 100 A monster is dead success = True running = False break init_monster(m) else:
m.movetimes += 1 if m.movetimes > random.randint(60,100): m.movetimes = 0
m.heading(ultraman) if ultraman.dead == False: # If Altman wasn't dead mxy = mouse_pos() #
Coordinates of the mouse pointer if ultraman.distance(mxy) > 50: # If the distance to the mouse pointer is greater than 50 ultraman.heading(mxy)
# Facing the mouse pointer ultraman.fd(10) # move 10 Units if leftkey.down() and bullet.speed == 0: #
Press the left button to launch shootsound.play() bullet.goto(ultraman.pos()) bullet.setheading(
ultraman.heading()) bullet.speed = 20 # be careful ! Redefined speed bullet.show() else:
ultraman.move(0,-15) # Fall down if ultraman.ycor() < -height//2 - 20 : running =
False bullet.fd(bullet.speed) if bullet.collide_edge(): bullet.hide()
bullet.speed= 0
<> Effect display :

This is the effect of writing ~

Technology
©2019-2020 Toolsou All rights reserved,
What is a process , Concept of process ? Tang Seng team to lay off staff , Who will you lay off ?Oracle Database access performance optimization JVM Old age garbage collection Full GCweb Two front-end practical games ( Attached source code ) about linux command “iptables -F”, Don't carry it out easily navicat function sql File error 2021-06-03 A man is not born to be defeated Pandas And openpyxl Super combination of Library , bye ,Excel! It is never recommended to spend a lot of time studying for employment python