Commit 08568451 by BellCodeEditor

save project

parent 930b634b
apple.png

2.05 KB

bg.png

22.5 KB

body.png

1.4 KB

class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def b(self):
self.level+=1
self.hp+=50
self.attack+=4
hy=Hero('yase',300,20)
hy.b()
hy.b()
print("升级两次后,hy的等级为:",hy.level)
print("升级两次后,hy的血量值为:",hy.hp)
print("升级两次后,hy的攻击力为:",hy.attack)
\ No newline at end of file
down.png

2.01 KB

left.png

2.07 KB

File added
right.png

2.05 KB

import pygame
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
screen=pygame.display.set_mode((660,480))
\ No newline at end of file
up.png

2.05 KB

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment