click_game.py

Created by marius-layan

Created on February 05, 2024

1.85 KB

Click_game est un jeu dont le seul but est de cliquer. plus on clic sur le bouton ok, plus on gagne d’argent. Un menu est ouvrable avec la touche exe pour faire des améliorations (l’amélioration “update click” double le nombre de coins gagné par clic et “auto click” active et améliore l’auto clic)

pour cliquer: OK

menu: EXE

BON JEU !


from random import *
from kandinsky import *
from ion import *
a,b,play,click,up,auto,d,c,f=1,0,1,[],100,200,1,1,0
while True:
  if play==1:
    fill_rect(0,0,320,222,'black');draw_string("CLICK !",130,10,'white','black');draw_string("menu: [EXE]",208,202,'yellow','black')
    while True:
      if c!=1:
        if f==50:a+=c;f=0
        else:f+=1
      draw_string("coins: "+str(a),2,202,'white','black')
      if click!=[]:
        b+=1;fill_rect(click[-1][0]+5,click[-1][1],2,12,'white');fill_rect(click[-1][0],click[-1][1]+5,12,2,'white')
        if b==30:b=0;fill_rect(click[0][0]+5,click[0][1],2,12,'black');fill_rect(click[0][0],click[0][1]+5,12,2,'black');del click[0]
      if keydown(KEY_OK):
        a+=d;click.append([randint(0,280),randint(30,182)])
        while keydown(KEY_OK):continue
      if keydown(KEY_EXE):
        play=0
        while keydown(KEY_EXE):continue
        break
  else:
    e=0;fill_rect(0,0,320,222,'black');draw_string(" MENU ",130,10,'white','black');draw_string("click: [EXE]",198,202,'yellow','black');draw_string(" update click ",20,70,'white',(50,50,50));draw_string(" auto click ",20,110,'white',(50,50,50))
    while True:
      if e==0:
        if a>=up:draw_string(str(up)+" coins",165,70,'green','black')
        else:draw_string(str(up)+" coins",165,70,'red','black')
        draw_string(str(auto)+" coins",145,110,(50,50,50),'black')
      else:
        if a>=auto:draw_string(str(auto)+" coins",145,110,'green','black')
        else:draw_string(str(auto)+" coins",145,110,'red','black')
        draw_string(str(up)+" coins",165,70,(50,50,50),'black')
      if keydown(KEY_UP):e=0
      if keydown(KEY_DOWN):e=1
      if keydown(KEY_OK):
        if e==0 and a>=up:a-=up;up*=3;d*=2
        if e==1 and a>=auto:a-=auto;auto*=3;c*=2
      if keydown(KEY_EXE):
        play=1
        while keydown(KEY_EXE):continue
        break