Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- restart_text = [500,20,100,50,"Restart",color(50,156,69)]
- pause_text = [500,70,100,50,"Pause",color(69,11,200)]
- throw_text = [270,450,100,50,"Throw",color(255,99,71)]
- score_text = [500,120,100,50,"Scores",color(0,191,255)]
- textboxes = [restart_text,pause_text,throw_text,score_text]
- def drawtextboxes(textboxes):
- textSize(30)
- fill(255)
- for i in range(len(textboxes)):
- fill(textboxes[i][5])
- rect(textboxes[i][0],textboxes[i][1],textboxes[i][2],textboxes[i][3])
- fill(255)
- text(textboxes[i][4],textboxes[i][0],textboxes[i][1]+35)
- def isClicked(info):
- clicked = False
- if mousePressed and mouseButton == LEFT:
- if info[0] < mouseX < info[0] + info[2] and info[1] < mouseY < info[1] + info[3]:
- clicked = True
- return clicked
- drawtextboxes(textboxes)
- if isClicked(textboxes[2]):
- throw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement