stacky_bird.py

Created by elnix91

Created on October 11, 2025

1.6 KB

Not Finished yet A game that you can play when you’re bored and it don’t work either on normal numwors OS, use Omega or upsilon


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

SKY=(0,0,0)
BIRD_C=((255,255,0))
BIRD_D=((200,200,0))
WALL=(200,20,100)

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

def bird(h):
#  for i in range(h):
#    if i==h-1:c=BIRD_D
#    else:c=BIRD_C
  rt(70,200-h*25,25,25,BIRD_C)
  if h>1:rt(70,200-(h-1)*25,25,25,BIRD_D)


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

# s: seed, real between 0 & 1, lower is easie
def create_new_wall(s):
  wall=[]
  max_walls=int(s*10)
  added_walls=0
  for i in range(8):
    if added_walls<max_walls:
      if ra()<s:
        wall.append(ri(1,8))
        added_walls+=1
      else:
        wall.append(0)
  return wall

def dwall(wall,x):
  for i,j in enumerate(wall):
    if j>0:
      rt(x,j*25,25,25,WALL)
#      sleep(0.1)
      rt(x+i*25,j*25,25,25,SKY)
#      sleep(0.1)
#  raise


while 1:
  # INIT GAME
  max_S=9
  val_p=1
  size=1
  wall=None
  X=12
  S=.1
  while 1:
    # GAME LOOP
    
    # Button logic to make bird go up
    if val_p and not ok():val_p=0
    if ok() and not val_p:
      if size<8:size+=1
      val_p=1
      bird(size)

    # Walls logic, make them appear and kill
    if X<=-8:
      X=12
      wall=None
    if not wall:
      wall=create_new_wall(S)
      if S<max_S:
        S+=ra()/10
    if wall:
      X-=1
      dwall(wall,X)

    # Collision system
    if 2<X<-6:
      for i,l in enumerate(wall[:size-1]):
        if i==0: # Head: if touch, die
        if X<(2+l):
          


    sleep(0.01)

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.