cliker_simulatorv3.py

Created by pommecrafter

Created on March 12, 2023

7.61 KB

la version finale (peut être) de mon tout premier jeu en python publié le 30 octobre 2022

il y a une commande secrète pour se give de l’argent !!! a vous de la trouver en regardant le code ou aller sur mon discord pour demander la solution !!!

mon discord : https://discord.gg/7trVDKHs


from math import *
from kandinsky import *
from ion import *
from time import *
from random import *

tp=1
#cmd
#chifres position
cpos=125
#money gived
mg=0
#nombre de chiffres
nbch=0
#other
tuneposition=[0,215,205]
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 cmd(cpos,mg,nbch,tune):
  fill_rect(60,61,200,100,(0,0,0))
  fill_rect(60,61,200,10,(225,225,225))  
  draw_string("/give ",65,106,(0,255,0),(0,0,0))
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),tuneposition[tp],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)
#cmd(cpos,mg,nbch,tune)
while 1:
  if locate=="cmd":
    if keydown(KEY_EXE):
      tune=tune+mg
      mg=0
      cpos=125
      nbch=0
      interface(tune,capacite,clic,multiplicateur)
      locate="interface"
      sleep(0.35)
    if keydown(KEY_ONE):
      draw_string("1",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+1
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_TWO):
      draw_string("2",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+2
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_THREE):
      draw_string("3",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+3
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_FOUR):
      draw_string("4",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+4
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_FIVE):
      draw_string("5",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+5
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_SIX):
      draw_string("6",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+6
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_SEVEN):
      draw_string("7",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+7
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_EIGHT):
      draw_string("8",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+8
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_NINE):
      draw_string("9",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+9
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
    if keydown(KEY_ZERO):
      draw_string("0",cpos,106,(0,255,0),(0,0,0))
      mg=mg*10+0
      nbch=nbch+1
      cpos=cpos+10
      sleep(0.35)
  
  
  
  
  
  
  
  

#    if keydown(KEY_ONE or KEY_TWO or KEY_THREE or KEY_FOUR or KEY_FIVE or KEY_SIX or KEY_SEVEN or KEY_EIGHT or KEY_NINE):
      
      
      
    
  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):
      cmd(cpos,mg,nbch,tune)
      locate="cmd"
      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>=999:
    tp=2
  if tune<999:
    tp=1
  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.