clicker.py

Created by elnix91

Created on October 11, 2025

1.74 KB

A clicker game, not finished yet works only in Omega/Upsilon due to f-strings i think


from kandinsky import draw_string as st, fill_rect as rt,set_pixel as px
from random import random as ra,randint as ri,choice as ch
from ion import keydown as k
from time import sleep

try:
  from os import *
  OS=1
except:OS=0


SKY=(0,0,0)
PRI=((255,255,0))
SEC=((200,200,0))

file="clicker_save.sav"

def rc():
  return (ri(0,255),ri(0,255),ri(0,255))


def ok():
  if k(4) or k(52):
    return 1
  return 0

def get_p1(i):
  return int(10*1.03**i)

def get_p2(a):
  return int(20*1.04**a)


Ok=0
_1=0
_2=0
_3=0
_4=0


if OS:
  try:
    with open(file,"r")as f:
      t=f.read().split(",")
      M=int(t[0])
      I=int(t[1])
      A=int(t[2])
      C=int(t[3])
  except:
    M=0
    I=1
    A=0
    C=1
else:
  M=0
  I=1
  A=0
  C=1

F=1
#M=0
#I=1
#A=1

price_1=get_p1(I)
price_2=get_p2(A)

# Main loop
while 1:

  if not ok() and not Ok:Ok=1
  if ok() and Ok:
    Ok=0
    M+=I
    for i in range(20):
      st(f"+ {I}",155-len(str(I))*5,100-i*3,PRI)
      sleep(0.01)
    rt(145-len(str(I))*5,40,90+len(str(I))*10,20,SKY)
    F=1

  if not k(42) and not _1:_1=1
  if k(42) and _1:
    _1=0
    price_1=get_p1(I)
    if M>price_1:
      M-=price_1
      I+=1
      price_1=get_p1(I)
      F=1

  if not k(43) and not _2:_2=1
  if k(43) and _2:
    _2=0
    price_2=get_p2(A)
    if M>price_2:
      M-=price_2
      A+=1
      price_2=get_p2(A)
      F=1
      for i in range(1,A+1,3):
        rt(i,20,3,3,SEC)


  if A>0:
    
         

      
  if F:
    F=0
    st(f"- 0.01s cooldown: {price_3} → [3]",0,160)
    st(f"+ 1 per click: {price_1} → [1]",0,202)
    st(f"+ 1 autoClick: {price_2} → [2]",0,180)
    st(str(M),0,0)
    rt(len(str(M))*10+10,0,320,20,SKY)
    if OS:
      with open(file,"w")as f:
        f.write(str(M)+","+str(I)+","+str(A)+","+str(C))

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.