cliker_simulator.py

Created by pommecrafter

Created on February 11, 2023

5.5 KB

la version finale de cliker_simulator est enfin sortie donc j’espère que cela vous plaira et je vous souhaite une très bonne expérience ☺


from math import *
from kandinsky import *
from ion import *
from time import *
from random import *
cout1=15
cout2=10
chantier="en devloppment"
tune=0
capacite=10
clic=0
multiplicateur=1
locate="interface"
print(locate)
line_color=[255,255,255]
bG_color='red'
def transition():
  for j in (line_color,bG_color):
    for i in range(0,340,20):
      fill_rect(0,0,i,222,j)
      sleep(0.01)
def arierre_plan():
  fill_rect(0,0,320,222,'red')
  fill_rect(0,0,360,20,'gray')
  fill_rect(0,202,360,20,'gray')
def interface(tune,capacite,clic,multiplicateur):
  locate="interface"
  arierre_plan()
  draw_string("cliker simulator",90,111,'white','red')
  draw_string("argent "+str(tune),215,0,'white','gray')
  draw_string("clic "+str(clic)+"/"+str(capacite),210,202,'white','gray')
  draw_string("x"+str(multiplicateur),140,202,'white','gray')
  draw_string("vendre(/)",20,202,'white','gray')
  draw_string("shop(5)",20,0,'white','gray')
  draw_string("argent>2000,capacite>100",50,50,'white','red')
  draw_string("multiplicateur>10,clic>100",30,70,'white','red')
def shop(cout1,cout2,capacite,clic,multiplicateur,tune):
  locate="shop"
  fill_rect(0,0,320,222,'green')
  fill_rect(0,0,360,20,'gray')
  fill_rect(20,40,130,170,'gray')
  fill_rect(20+150,40,130,170,'gray')
  draw_string("retour(CLEAR)",100,202,'white','green')
  draw_string("argent "+str(tune),135,0,'white','gray')
  draw_string("multipli",40,40,'white','gray')
  draw_string("cateur",55,60,'white','gray')
  draw_string("cappacite",190,40,'white','gray')  
  draw_string("x"+str(multiplicateur+1),60,120,'white','gray')  
  draw_string("prix "+str(cout1),50,180,'white','gray')
  draw_string(str(capacite)+" => "+str(capacite+5),200,120,'white','gray')
  draw_string("prix "+str(cout2),200,180,'white','gray')  
def menu():
  locate="menu"
  fill_rect(0,0,320,222,'orange')
  fill_rect(20,40-15,130,170,'gray')
  fill_rect(20+150,40-15,130,170,'gray')
  draw_string("shop",65,100,'white','gray')
  draw_string("vendre",200,100,'white','gray')
  draw_string("tu est plein",105,25,'white','gray')
def ecran(w):
    locate="screen" 
    t = 0
    h = int(.8 * w)
    wd,hd = w//2, h//2

    ta = 320 // w
    while True:
     coul = randint(100,1000)  
     for c in range(w):       

        for l in range(h):
            r = (c - wd) ** 2 + (l - hd) ** 2
            d = abs(1 + int(ta / 2 * sin(2 * pi * (r + t) / 90)))
            if c == wd: dx = 0

            elif c > wd: dx = 1
            else: dx = -1
            if l == hd: dy = 0
            elif l > hd: dy = 1

            else: dy = -1
            tad = ta // 2
            fill_rect(ta * c + dx * tad,ta * l + dy * tad,3 * tad,3 * tad ,(0,0,0))
            fill_rect(ta * c + dx * d,ta * l + dy * d,d,d,(coul,.9 * coul,0))
            draw_string("felicitation !!!",100,20,'white','black')
            draw_string("Key BACK → leave",100,190,'white','black')
     t = (t + 1) % 90    
     sleep(random()/100)    
   
interface(tune,capacite,clic,multiplicateur)
while 1:
  if locate=="interface":
    if keydown(KEY_FIVE):
      bG_color='green'
      transition()
      shop(cout1,cout2,capacite,clic,multiplicateur,tune)
      locate="shop"
      sleep(0.35)
      print(locate)      
    if keydown(KEY_EXE):
      clic=clic+1*multiplicateur
      interface(tune,capacite,clic,multiplicateur)
      sleep(0.25)        
      if clic>(capacite-1/multiplicateur):
        bG_color='orange'
        transition()
        clic=capacite
        menu()
        locate="menu"  
    if keydown(KEY_DIVISION):
      tune=tune+clic
      clic=0
      interface(tune,capacite,clic,multiplicateur)
      locate="interface"
      sleep(0.35)  
    if keydown(KEY_SHIFT) and keydown(KEY_BACKSPACE):
      tune=tune+randint(10,100)
      interface(tune,capacite,clic,multiplicateur)
      locate="interface"
      sleep(1)
  if locate=="shop":
    if keydown(KEY_BACKSPACE):
      bG_color='red'
      transition()
      interface(tune,capacite,clic,multiplicateur)
      locate="interface"
      sleep(0.35)
      print(locate)
    if keydown(KEY_ONE):
      if tune<cout1:
        draw_string("pas assez d argent",100,150,'white','red')
        sleep(1.25)
        shop(cout1,cout2,capacite,clic,multiplicateur,tune)
        locate="shop"
      else:  
        tune=tune-cout1
        multiplicateur=multiplicateur+1
        cout1=cout1+cout2
        shop(cout1,cout2,capacite,clic,multiplicateur,tune)
        locate="shop"
        sleep(0.35)
    if keydown(KEY_TWO):
      if tune<cout2:
        draw_string("pas assez d argent",100,150,'white','red')      
        sleep(1.25)
        shop(cout1,cout2,capacite,clic,multiplicateur,tune)
        locate="shop"
      else:
        tune=tune-cout2
        capacite=capacite+5
        cout2=cout2+10
        shop(cout1,cout2,capacite,clic,multiplicateur,tune)
        locate="shop"
        sleep(0.35)
  if locate=="menu":
    if keydown(KEY_ONE):
      bG_color='green'
      transition()
      shop(cout1,cout2,capacite,clic,multiplicateur,tune)
      locate="shop"
      sleep(0.35)
    if keydown(KEY_TWO):
      bG_color='red'
      transition()
      tune=tune+clic
      clic=0 
      interface(tune,capacite,clic,multiplicateur)
      locate="interface"
      sleep(0.35)
  if tune>=2000 and capacite>=100 and multiplicateur>=10 and clic>=100:
    fill_rect(0,0,320,222,(0,0,0)) 
    ecran(16)
    locate="screen"
  if locate=="screen":
    if keydown(KEY_EXE):
      cout1=15
      cout2=10
      tune=0
      capacite=10
      clic=0
      multiplicateur=1
      interface(tune,capacite,clic,multiplicateur)
      locate="interface"

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.