Notes
![]() ![]() Notes - notes.io |
pygame.init()
pygame.display.set_caption("CPS tracker")
window = pygame.display.set_mode((750, 500))
pygame.font.init()
run = True
counter=0
size=(50,50)#blit for click counter
class countdown:
def __init__(self,timer):
self.starttime = timer
self.timer=timer
self.clock = pygame.time.Clock()
self.dt=0
self.convert2='0'
def timeIt(self):
self.timer -= self.dt
if self.timer <= 0:
self.timer = 0.00
self.convert2 ="{:.2f}".format(self.timer)
self.dt = self.clock.tick(30) / 1000
mousedown = False
mytimer=countdown(5)
firstClick = False
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
mouse = pygame.mouse.get_pressed()
background = pygame.Surface(size)
if mouse[0]== True: #mouse clicked
firstClick = True
mousedown = True
else:# mouse realeased
if mousedown==True:
# mytimer.timeIt();
convert=str(counter)
myfont = pygame.font.SysFont('Comic Sans MS', 30)
textsurface = myfont.render(convert, False, (255, 255, 255))
window.blit(background,(0,0))
window.blit(textsurface,(0,0))
pygame.display.update()
if mytimer.timer > 0:
#only increment the counter if the timer valaue is greater than 0.
counter=counter+1
mousedown=False
if firstClick == True:
mytimer.timeIt();
size2= (100,60)
background2 = pygame.Surface(size2)
myfont = pygame.font.SysFont('Comic Sans MS', 30)
timersurface = myfont.render(mytimer.convert2, False, (255, 255, 255))
window.blit(background2,(650,0))
window.blit(timersurface,(650,0))
pygame.display.update()
if mytimer.timer == 0:
cps = str(counter/mytimer.starttime)
size3 = (50,50)
background3 =pygame.Surface(size2)
myfont = pygame.font.SysFont('Comic Sans MS', 100)
cpssurface = myfont.render(cps, False, (255, 255, 255))
window.blit(background3,(300,150))
window.blit(cpssurface,(300,150))
pygame.display.update()
pygame.quit()
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team