示例#1
0
文件: main.py 项目: MCreese2/com404
from Bot import Bot
from SuperBot import SuperBot
from FlyingBot import FlyingBot

#Creates an object "walle" with parameters of the bot class
walle = Bot("Wall-E", 15, 25, 20)

superwalle = SuperBot("Super Walle-E", 20, 30, 25, 15)

flyingsuperwalle = FlyingBot("Flying Super Walle-E", 25, 35, 30, 20, 5)

#Invoked the methods on the bot class
walle.display_name()
walle.display_age()
walle.display_energy()
walle.display_shield()

superwalle.display_name()
superwalle.display_age()
superwalle.display_energy()
superwalle.display_shield()
#invokes the superbot method
superwalle.display_super_power_level()

flyingsuperwalle.display_name()
flyingsuperwalle.display_age()
flyingsuperwalle.display_energy()
flyingsuperwalle.display_shield()
flyingsuperwalle.display_super_power_level()
#invokes the flying bot method
flyingsuperwalle.display_hover()
示例#2
0
文件: main.py 项目: JordanDG/com404
from SuperBot import SuperBot
from FlyingBot import FlyingBot

test = Bot("Botty")

test.get_age()
test.get_energy()
test.get_name()
test.get_shield()

test.decrement_energy()
test.decrement_shield()

test.display_name()
test.display_age()
test.display_energy()
test.display_shield_level()
test.display_summary()
print(test.__str__())

test.increment_age()
test.increment_energy()
test.increment_shield()

test.set_name()

super_bot = SuperBot("John")

super_bot.get_super_power_level(3000)
super_bot.set_super_power_level(3000)