Advertisement
Guest User

Help Me lol

a guest
Oct 22nd, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.32 KB | None | 0 0
  1. #Background
  2. app.background = 'black'
  3.  
  4. #Bob-omb
  5. Circle(200,100,30, fill=None, border='white')
  6. Oval(190,100,10,30, fill='white') #Right Eye
  7. Oval(210,100,10,30, fill='white') #Left Eye
  8. Oval(187,133,20,10, fill='yellow') #Right Leg
  9. Oval(400-187,133, 20,10, fill='yellow') #Left Leg
  10. Rect(187,65, 25, 5, fill='lightBlue') #Fuse Box???
  11. Rect(200,50,1,15, fill='white') #String
  12.  
  13.  
  14. #Menu Split + Health Bar
  15. Line(0,200,400,200, fill='red') #Menu Split
  16. Rect(100,160, 200,25, fill='grey') #Health Bar Background
  17. healthBar = Rect(100,160, 200,25, fill='lime') #Health Status
  18. Rect(100,160,200,25,fill=None,border='red') #Health Bar Box
  19.  
  20. #Functions
  21.  
  22.  
  23. def inRect(rect, x,y):
  24. l = rect.left
  25. r = rect.right
  26. t = rect.top
  27. b = rect.bottom
  28.  
  29. return (x>=l and x<=r) and (y>=t and y<=b)
  30.  
  31.  
  32. #Attack Options
  33.  
  34. attackA = Label('Attack',100,244, fill=None, border='red', borderWidth=2,
  35. size=35)
  36.  
  37. rectA = Rect(25,220,150,50, fill=None, border='red')
  38.  
  39.  
  40.  
  41. attackB = Label('Attack', 300,244, fill=None, border='red', borderWidth=2,
  42. size=35)
  43.  
  44. rectB = Rect(225,220,150,50, fill=None, border='red')
  45.  
  46.  
  47.  
  48. attackC = Label('Attack', 100,344, fill=None, border='red', borderWidth=2,
  49. size=35)
  50.  
  51. rectC = Rect(25,320,150,50, fill=None, border='red')
  52.  
  53.  
  54.  
  55. attackD = Label('Attack', 300,344, fill=None, border='red', borderWidth=2,
  56. size=35)
  57.  
  58. rectD = Rect(225, 320,150,50, fill=None, border='red')
  59.  
  60. #####Damage Dealt Effects! #####
  61.  
  62. #Fire Orb
  63.  
  64.  
  65. fireOrb = Circle(200,100,35)
  66. fireOrb.visible = False
  67. fireOrb.fill = 'orange'
  68. fireOrb.opacity = 50
  69.  
  70. #Super Jump
  71. superJump = Star(211,82, 20, 4)
  72. superJump.visible = False
  73. superJump.fill=gradient('white','skyBlue')
  74. superJump.roundness = 20
  75.  
  76. #Thunderbolt
  77. thunderBolt = Star(211,82, 35, 8)
  78. thunderBolt.visible = False
  79. thunderBolt.fill = 'yellow'
  80. thunderBolt.roundness = 25
  81.  
  82. thunderBolt2 = Star(180, 112, 25, 8)
  83. thunderBolt2.visible = False
  84. thunderBolt2.fill = 'yellow'
  85. thunderBolt2.roundness = 25
  86.  
  87. #Poison Gas
  88. poisonGas = Circle(200,100,35)
  89. poisonGas.visible = False
  90. poisonGas.fill=gradient('lime','forestGreen')
  91. poisonGas.opacity=50
  92.  
  93. ### Random Number
  94.  
  95. damageDealt = Label(randrange(0,70), 260,90, fill=None, border='red',
  96. borderWidth=2, size=40)
  97.  
  98. damageDealt.visible = False
  99.  
  100. #Stats
  101. maxHealth = 100
  102. health = maxHealth
  103.  
  104.  
  105. def setHealth(val):
  106. b = globals()["healthBar"]
  107.  
  108. percent = val/maxHealth
  109.  
  110. healthBar.width = 200*percent
  111.  
  112.  
  113. #Amount of Health
  114. setHealth(health)
  115.  
  116.  
  117. ###Attack Functions###
  118. rectA
  119. attackA.value = 'Fire Orb'
  120. attackA.border=gradient('orange','red',start='bottom')
  121.  
  122.  
  123. def onMousePress(mouseX, mouseY):
  124. if inRect(rectA, mouseX, mouseY): #Fire Orb Attack
  125. damageDealt.visible = True
  126. damageDealt.value = randrange(15,25)
  127. fireOrb.visible=True
  128. healthBar.width -= damageDealt.value/5
  129. if inRect(rectB, mouseX, mouseY): #Super Jump Attack
  130. damageDealt.visible = True
  131. damageDealt.value = randrange(5,15)
  132. superJump.visible=True
  133. healthBar.width -= damageDealt.value/5
  134. if inRect(rectC, mouseX, mouseY): #Thunderbolt Attack
  135. damageDealt.visible = True
  136. damageDealt.value = randrange(10,25)
  137. thunderBolt.visible=True
  138. thunderBolt2.visible=True
  139. healthBar.width -= damageDealt.value/5
  140. if inRect(rectD, mouseX, mouseY): #Poison Gas Attack
  141. damageDealt.visible = True
  142. damageDealt.value = randrange(12,20)
  143. poisonGas.visible=True
  144. healthBar.width -= damageDealt.value/5
  145. def onMouseRelease(mouseX, mouseY):
  146. damageDealt.visible = False
  147. fireOrb.visible=False
  148. superJump.visible=False
  149. thunderBolt.visible=False
  150. thunderBolt2.visible=False
  151. poisonGas.visible=False
  152. return
  153.  
  154.  
  155. ###Super Jump###
  156. rectB
  157. attackB.value = 'Super Jump'
  158. attackB.border=gradient('sienna','grey', start='top')
  159. attackB.size = 26
  160.  
  161.  
  162. ###Thunderbolt###
  163. rectC
  164. attackC.value = 'Thunderbolt'
  165. attackC.border=gradient('yellow','gold')
  166. attackC.size = 26
  167.  
  168.  
  169. ###Poison Gas###
  170. rectD
  171. attackD.value = 'Poison Gas'
  172. attackD.border=gradient('lime','forestGreen')
  173. attackD.size = 27
  174.  
  175.  
  176. #Low Health Sign
  177. if health/maxHealth <= 0.5:
  178. Label('Low Health!', 85, 50, fill=None, border='red')
  179. print('e')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement