booble2.py

Created by mathieu-croslacoste

Created on September 15, 2025

1.45 KB

Upsilon only. https://yaya-cout.github.io/Upsilon-Workshop/view/f463150d-e2c6-4d47-ad0f-d280021db6e0 compressed + optimized


from kandinsky import fill_rect as F,fill_circle as C,draw_string as D,wait_vblank as W
from random import randint as R,seed
from ion import keydown as K
camx=0
camy=0
run=1
sens=int(input("Sensibilite (defaut:5):"))
seed(int(input("Seed:")))
up=0
F(0,0,320,222,"k")
class Player:
 def __init__(s):s.x=120;s.y=50;s.charge=0;s.score=0;s.oldx=0;s.oldy=0
 def displace(s):
  if K(3):s.x+=sens
  if K(0):s.x-=sens
 def draw(s):C(s.x-camx,int(s.y-camy),4,"r")
 def grav(s):s.y+=s.charge
 def updtCharge(s):s.charge+=.5
 def collide(s):
  if s.y>=plat.y and s.y<=plat.y+12:
   if s.x>=plat.x and s.x<=plat.x+50:s.charge=-14;s.score+=1;plat.displace()
 def checkDeath(s):
  if s.y-camy>=300:run=0;D("Mort!",100,50);D("score:"+str(s.score),100,80)
 def Score(s):D("score:"+str(s.score),220,0)
 def updtCam(s):
  global camy
  if s.y-camy<=50:camy-=8
 def takePos(s):s.oldx=s.x-camx;s.oldy=s.y-camy
 def refresh(s):C(int(s.oldx),int(s.oldy),4,"k")
class Platform:
 def __init__(s):s.x=100;s.y=150;s.oldx=0;s.oldy=0
 def draw(s):F(s.x-camx,s.y-camy,50,10,(0,155,0))
 def displace(s):global up;s.y-=R(80,100);s.x=R(0,230);up=1
 def takePos(s):s.oldx=s.x-camx;s.oldy=s.y-camy
 def refresh(s):F(s.oldx,s.oldy,50,10,"k")
p=Player()
plat=Platform()
def updt():p.grav();p.collide();p.displace();p.checkDeath();p.updtCharge();plat.refresh();p.refresh();plat.draw();p.draw();p.takePos();plat.takePos();p.updtCam();p.Score()
while run:
 updt();W()
 if p.score%25==0 and up:sens+=1;up=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.