clicker.py

Created by fixem

Created on January 26, 2025

2.56 KB

Cookie clicker, necessite installation du module color disponible sur mon compte


from kandinsky import *
from random import *
from color import *
from ion import *
"""
Jeu codé par FIXEM
"""
print("0->PAUSE\nEXE->MAGASIN\nANS->RETOUR\nOK->CLICKER/ACHETER")
while not keydown(KEY_OK):sleep(0)
ab=0
bon= [1,5,25,100,500,1000,5000,10000,50000,100000]
prix= [5,750,10000,250000,1000000,4000000,16000000,80000000,120000000,1000000000]
prix1=[10,1500,60000,300000,1500000,4000000,16000000,300000000,240000000,1000000000]
one,two,thr,fou,fiv,six=0,0,0,0,0,0
xp,yp,tp=[],[],[]
for i in range(8):
  a=randint(70,110)
  b=randint(40,80)
  c=randint(5,9)
  xp.append(a);yp.append(b);tp.append(c)
cookie=0
plus=1
auto=0
def coo(x,y,t,c):
  fill_rect(x,y,t,t,c)
  for i in range(len(xp)):
    fill_rect(xp[i],yp[i],tp[i],tp[i],marron)
z=False
y=0
a=monotonic()
while 1:
  if z:
    z=False
    a=monotonic()-y
    cookie+=auto*a
  if keydown(KEY_ZERO):
    z=True
    y=monotonic()
    pause=input("C'est sur pause, tu peux eteindre ;)")
  b=monotonic()-a
  draw_string(str(int(cookie)),0,0)
  draw_string("+"+str(int(auto))+"/sec",200,50)
  draw_string("+"+str(int(plus))+"/click",200,70)
  if b>=1:
    a=monotonic()
    cookie+=auto
  coo(50,20,100,beige)
  if keydown(KEY_OK):
    coo(50,20,100,blanc)
    coo(65,35,70,beige)
    cookie+=plus
    while keydown(KEY_OK):
      sleep(0)
  if keydown(KEY_EXE):
    b=1
    fill_rect(0,0,320,222,noir)
    while 1:
      draw_string(str(int(cookie))+" "*15,50,80,blanc,noir)
      draw_string("+"+str(int(auto))+"/sec"+" "*15,50,110,blanc,noir)
      draw_string("+"+str(int(plus))+"/click"+" "*15,50,140,blanc,noir)
      o=monotonic()-a
      if o>=1:
        a=monotonic()
        cookie+=auto
      if b==1:
        draw_string(str(bon[ab])+"/clic"+"->"+str(int(prix[ab]))+" "*15,50,50,blanc,noir)
      elif b==0:
        draw_string(str(bon[ab])+"/sec"+"->"+str(int(prix1[ab]))+" "*15,50,50,blanc,noir)
      if keydown(KEY_UP)and ab<7:
        ab+=1
        while keydown(KEY_UP):sleep(0)
      if keydown(KEY_DOWN)and ab>0:
        ab-=1
        while keydown(KEY_DOWN):sleep(0)
      if keydown(KEY_RIGHT):
        b=1
        while keydown(KEY_RIGHT):sleep(0)
      if keydown(KEY_LEFT):
        b=0
        while keydown(KEY_LEFT):sleep(0)
      if keydown(KEY_ANS):
        fill_rect(0,0,320,222,blanc)
        break
      if keydown(KEY_OK):
        if b==1 and cookie>=int(prix[ab]):
          cookie-=int(prix[ab])
          plus+=bon[ab]
          prix[ab]*=1.1
        if b==0 and cookie>int(prix1[ab]):
          cookie-=int(prix1[ab])
          auto+=bon[ab]
          prix1[ab]*=1.1
        while keydown(KEY_OK):
          sleep(0)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.