Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Background
- app.background = 'black'
- #Bob-omb
- Circle(200,100,30, fill=None, border='white')
- Oval(190,100,10,30, fill='white') #Right Eye
- Oval(210,100,10,30, fill='white') #Left Eye
- Oval(187,133,20,10, fill='yellow') #Right Leg
- Oval(400-187,133, 20,10, fill='yellow') #Left Leg
- Rect(187,65, 25, 5, fill='lightBlue') #Fuse Box???
- Rect(200,50,1,15, fill='white') #String
- #Menu Split + Health Bar
- Line(0,200,400,200, fill='red') #Menu Split
- Rect(100,160, 200,25, fill='grey') #Health Bar Background
- healthBar = Rect(100,160, 200,25, fill='lime') #Health Status
- Rect(100,160,200,25,fill=None,border='red') #Health Bar Box
- #Functions
- def inRect(rect, x,y):
- l = rect.left
- r = rect.right
- t = rect.top
- b = rect.bottom
- return (x>=l and x<=r) and (y>=t and y<=b)
- #Attack Options
- attackA = Label('Attack',100,244, fill=None, border='red', borderWidth=2,
- size=35)
- rectA = Rect(25,220,150,50, fill=None, border='red')
- attackB = Label('Attack', 300,244, fill=None, border='red', borderWidth=2,
- size=35)
- rectB = Rect(225,220,150,50, fill=None, border='red')
- attackC = Label('Attack', 100,344, fill=None, border='red', borderWidth=2,
- size=35)
- rectC = Rect(25,320,150,50, fill=None, border='red')
- attackD = Label('Attack', 300,344, fill=None, border='red', borderWidth=2,
- size=35)
- rectD = Rect(225, 320,150,50, fill=None, border='red')
- #####Damage Dealt Effects! #####
- #Fire Orb
- fireOrb = Circle(200,100,35)
- fireOrb.visible = False
- fireOrb.fill = 'orange'
- fireOrb.opacity = 50
- #Super Jump
- superJump = Star(211,82, 20, 4)
- superJump.visible = False
- superJump.fill=gradient('white','skyBlue')
- superJump.roundness = 20
- #Thunderbolt
- thunderBolt = Star(211,82, 35, 8)
- thunderBolt.visible = False
- thunderBolt.fill = 'yellow'
- thunderBolt.roundness = 25
- thunderBolt2 = Star(180, 112, 25, 8)
- thunderBolt2.visible = False
- thunderBolt2.fill = 'yellow'
- thunderBolt2.roundness = 25
- #Poison Gas
- poisonGas = Circle(200,100,35)
- poisonGas.visible = False
- poisonGas.fill=gradient('lime','forestGreen')
- poisonGas.opacity=50
- ### Random Number
- damageDealt = Label(randrange(0,70), 260,90, fill=None, border='red',
- borderWidth=2, size=40)
- damageDealt.visible = False
- #Stats
- maxHealth = 100
- health = maxHealth
- def setHealth(val):
- b = globals()["healthBar"]
- percent = val/maxHealth
- healthBar.width = 200*percent
- #Amount of Health
- setHealth(health)
- ###Attack Functions###
- rectA
- attackA.value = 'Fire Orb'
- attackA.border=gradient('orange','red',start='bottom')
- def onMousePress(mouseX, mouseY):
- if inRect(rectA, mouseX, mouseY): #Fire Orb Attack
- damageDealt.visible = True
- damageDealt.value = randrange(15,25)
- fireOrb.visible=True
- healthBar.width -= damageDealt.value/5
- if inRect(rectB, mouseX, mouseY): #Super Jump Attack
- damageDealt.visible = True
- damageDealt.value = randrange(5,15)
- superJump.visible=True
- healthBar.width -= damageDealt.value/5
- if inRect(rectC, mouseX, mouseY): #Thunderbolt Attack
- damageDealt.visible = True
- damageDealt.value = randrange(10,25)
- thunderBolt.visible=True
- thunderBolt2.visible=True
- healthBar.width -= damageDealt.value/5
- if inRect(rectD, mouseX, mouseY): #Poison Gas Attack
- damageDealt.visible = True
- damageDealt.value = randrange(12,20)
- poisonGas.visible=True
- healthBar.width -= damageDealt.value/5
- def onMouseRelease(mouseX, mouseY):
- damageDealt.visible = False
- fireOrb.visible=False
- superJump.visible=False
- thunderBolt.visible=False
- thunderBolt2.visible=False
- poisonGas.visible=False
- return
- ###Super Jump###
- rectB
- attackB.value = 'Super Jump'
- attackB.border=gradient('sienna','grey', start='top')
- attackB.size = 26
- ###Thunderbolt###
- rectC
- attackC.value = 'Thunderbolt'
- attackC.border=gradient('yellow','gold')
- attackC.size = 26
- ###Poison Gas###
- rectD
- attackD.value = 'Poison Gas'
- attackD.border=gradient('lime','forestGreen')
- attackD.size = 27
- #Low Health Sign
- if health/maxHealth <= 0.5:
- Label('Low Health!', 85, 50, fill=None, border='red')
- print('e')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement