egor_3.py

Created by wperez274

Created on September 08, 2022

2.07 KB


from math import *
from random import *
from random import randint as R
from kandinsky import *
from kandinsky import fill_rect as F
from ion import *
from time import *

game=True
jump=False
bg_1=(R(25,255),R(25,255),R(25,255))



MX=0
MY=0

g_1_x=MX+0
g_1_y=MY+190
g_1_w=MX+1500
g_1_h=1000
g_1_c=(R(25,255),R(25,255),R(25,255))


g_2_x=MX+0
g_2_y=MY+g_1_y+g_1_h
g_2_w=MX+2000
g_2_h=1000
g_2_c=(R(25,255),R(25,255),R(25,255))

px=140
pw=15
ph=17
py=g_1_y-ph-3
pc="orange"
pe=35

rect_1_x=MX+500
rect_1_w=R(200,500)
rect_1_h=R(70,155)
rect_1_y=g_1_y-rect_1_h
rect_1_c=(R(0,255),R(0,255),R(0,255))

F(0,0,322,g_1_y,bg_1)

F(MX+g_1_y,MY+g_1_y,g_1_w,g_1_h,g_1_c)

while game:
  
  F(MX+rect_1_x,MY+rect_1_y,rect_1_w,rect_1_h,rect_1_c)  
  F(MX+rect_1_x,MY+rect_1_y,3,rect_1_h,"black")  
  F(MX+rect_1_x+rect_1_w-3,rect_1_y,3,rect_1_h,"black")  
  F(MX+rect_1_x,rect_1_y,rect_1_w,3,"black")  
  F(MX+rect_1_x,rect_1_y+rect_1_h-3,rect_1_w,3,"black")  

  F(MX+g_1_x,MY+g_1_y,g_1_w,g_1_h,g_1_c)
  F(MX+g_1_x+g_1_w+1,MY+g_1_y,2,g_1_h,bg_1)
  F(MX+g_1_x+g_1_w-3,MY+g_1_y,3,g_1_h+g_1_h,"black")
  F(MX+g_1_x+g_1_w+1,MY+g_1_y,2,g_1_h+g_1_h,bg_1)

  F(MX+rect_1_x,MY+rect_1_y,rect_1_w,rect_1_h,rect_1_c)  




  F(px,py,pw,ph,pc)
  F(px+9,py-6,3,5,"black")
  F(px+9,py+3,5,1,"black")
  F(px,py-11,pw,4,"brown")
  F(px-2,py+ph,pw+2,5,"black")
  F(px,py-13,2,ph+13,"black")
  F(px+pw-2,py-13,2,ph+13,"black")
  F(px,py-13,pw,2,"black")
  F(px,py+ph-2,pw,2,"black")

  if keydown(KEY_RIGHT):
    sleep(0.005)
    MX-=2
    F(px-2,py,2,ph,bg_1)
    F(MX+rect_1_x+rect_1_w+1,rect_1_y,2,rect_1_h,bg_1)  


  if keydown(KEY_LEFT):
    sleep(0.005)
    MX+=2
    F(px-2,py,2,ph,bg_1)
    F(MX+rect_1_x-2,rect_1_y,2,rect_1_h,bg_1)  



  if px>MX+g_1_x+g_1_w and py+ph<MY+g_2_y-2:
  
    F(MX+g_1_x,MY+g_1_y,g_1_w,g_1_h,g_1_c)
    MY-=2
    F(0,0,322,222,bg_1)

      
  if py+ph>=MY+g_2_y:
    rect_1_w=R(200,500)
    rect_1_h=R(70,155)
    rect_1_c=(R(0,255),R(0,255),R(0,255))
    rect_1_x=MX+g_2_x+R(3,500)
    rect_1_y=MY+g_2_y-rect_1_h
    py=g_2_y-ph
    MY+=1    
  
  
  
#  F(MX+g_2_x,MY+g_2_y,g_2_w,g_2_h,g_2_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.