#WRITTEN BY: WILSON
frommathimport*fromrandomimport*fromrandomimportrandintasRfromkandinskyimport*fromkandinskyimportfill_rectasFfromionimport*fromtimeimport*REMIND=Nonerem=input("\n\nSet Reminder?\n\n 1) Yes 2) No\n\n")ifrem=="1"orrem=="w"orrem=="W":REMIND=Truenote=input("\nREMINDER?\n\n")else:rem==False#screen width
SW=322#screen height
SH=222game=Truegravity=Truejump=Falsep_on_platform=TrueT=300jump_height=10bg=(200,255,255)#/////////[IMPORTANT]//////////
#GAME MAP [0,210]
gx=0gy=210gw=10**4gh=12gc="brown"#///////////////////
area=1#//Player/////////////////
p_energy=35p_score=0px=154py=gy-35pw=16ph=35pc="orange"p_right=Truep_left=False#////////////////////////
#PLATFORMS
rectx=gx+R(250,400)rectw=R(70,120)recth=R(12,18)recty=gy-R(140,160)rectc="red"#choice(['blue','red','green','yellow','brown','white','pink','orange','purple','gray'])
rect_2_x=gx+R(400,500)rect_2_w=R(40,80)rect_2_h=R(20,50)rect_2_y=185-rect_2_hrect_2_c="white"#choice(['blue','red','green','yellow','brown','white','pink','orange','purple','gray'])
rect_3_x=gx+R(600,700)rect_3_y=R(140,180)rect_3_w=R(25,50)rect_3_h=R(40,100)rect_3_y=R(140,180)rect_3_c="blue"#(R(0,255),R(0,255),R(0,255))
rect_4_x=gx+R(700,800)rect_4_y=gy-R(120,170)rect_4_w=40rect_4_h=10rect_4_c="gray"lava_x=900lava_y=gy-12lava_w=SW*6lava_h=25lava_c=(140,0,0)area_x=[gx+2500,gx+3500,gx+5500]cloud_1_x=gx+R(300,500)cloud_1_y=25cloud_1_w=R(35,60)cloud_1_h=R(8,20)cloud_1_c="white"cloud_2_x=R(500,700)cloud_2_y=25cloud_2_w=R(35,60)cloud_2_h=R(8,20)cloud_2_c="white"cloud_3_x=gx+R(800,1000)cloud_3_y=25cloud_3_w=R(35,60)cloud_3_h=R(8,20)cloud_3_c="white"bullet_x=R(500,700)bullet_y=R(20,150)bullet_w=40bullet_h=20bullet_c="black"defPrintData():globalp_energy,p_score,areadraw_string("Energy:",2,2)F(75,4,round(p_energy),10,"red")F(75+round(p_energy),4,1,10,bg)draw_string(chr(36)+str(p_score),160,2,(0,55,0))draw_string("Area:"+str(area),250,2)F(0,0,322,222,bg)F(gx,gy-2,gw,3,"blue")while1:#clouds float West..
cloud_1_x-=choice([0,0,1])cloud_2_x-=choice([0,0,1])cloud_3_x-=choice([0,0,1])#////SHOW clouds/////
#CLOUD 1
F(cloud_1_x,cloud_1_y,1,cloud_1_h,cloud_1_c)# cloud 1 outline
F(cloud_1_x+cloud_1_w-2,cloud_1_y,2,cloud_1_h,"cyan")F(cloud_1_x,cloud_1_y,cloud_1_w,2,"cyan")F(cloud_1_x,cloud_1_y+cloud_1_h-2,cloud_1_w,2,"cyan")#CLOUD 2
F(cloud_2_x,cloud_2_y,1,cloud_2_h,cloud_2_c)# cloud 2 outline
F(cloud_2_x+cloud_2_w-2,cloud_2_y,2,cloud_2_h,"cyan")F(cloud_2_x,cloud_2_y,cloud_2_w,2,"cyan")F(cloud_2_x,cloud_2_y+cloud_2_h-2,cloud_2_w,2,"cyan")#CLOUD 3
F(cloud_3_x,cloud_3_y,1,cloud_3_h,cloud_3_c)# cloud 3 outline
F(cloud_3_x+cloud_3_w-2,cloud_3_y,2,cloud_3_h,"cyan")F(cloud_3_x,cloud_3_y,cloud_3_w,2,"cyan")F(cloud_3_x,cloud_3_y+cloud_3_h-2,cloud_3_w,2,"cyan")#Erase all 3 cloud trails..
F(cloud_1_x+cloud_1_w,cloud_1_y,1,cloud_1_h,bg)F(cloud_2_x+cloud_2_w,cloud_2_y,1,cloud_2_h,bg)F(cloud_3_x+cloud_3_w,cloud_3_y,1,cloud_3_h,bg)#Randomize clouds size,
#measurements and locations..
ifcloud_1_x+cloud_1_w<=0-R(50,100):cloud_1_x=R(400,600)cloud_1_y=R(20,60)cloud_1_w=R(40,70)cloud_1_h=R(20,40)ifcloud_2_x+cloud_2_w<=0-R(50,100):cloud_2_x=R(600,800)cloud_2_y=R(20,60)cloud_2_w=R(40,70)cloud_2_h=R(20,40)ifcloud_3_x+cloud_3_w<=0-R(50,100):cloud_3_x=R(900,1000)cloud_3_y=R(20,60)cloud_3_w=R(40,70)cloud_3_h=R(20,40)#enery,score,etc.
# PrintData()
F(gx,gy-2,gw,2,"green")#AREA to the Left
#wall
F(gx-195,0,5,190,"cyan")F(gx-190,0,1,190,bg)#////ATTENTION/////////////
#///AREA to the RIGHT DARK AND GROOVY :-|
ifpx>=gx+area_x[0]:F(gx+2900,0,4000,222,"black")#////( AREA 2!! )////////
#Line to indicate new Area..
F(gx+2895,20,5,222,"cyan")#erase line trail..
F(gx+2894,20,1,222,bg)F(gx+2895+2001,20,1,222,bg)#////////////////////////
#Player in Lava :-(
ifpx+pw>=gx+lava_xandpx<=gx+lava_x+lava_wandpy+ph>=gy:p_energy-=0.09F(px,py,pw,ph,"red")F(px,py-8,round(p_energy/2),4,"red")F(px+round(p_energy/2),py-8,2,4,bg)F(px-2,py-8,2,4,bg)#////////////////////////
#move left/right
ifkeydown(KEY_RIGHT):px+=2F(px-2,py,2,ph,bg)#CONTAIN PLAYER
#map moves
ifkeydown(KEY_LEFT):px-=2F(px+pw,py,2,ph,bg)ifkeydown(KEY_LEFT)andpx<80:gx+=2px=80F(px,py,2,ph,bg)ifkeydown(KEY_RIGHT)andpx+pw>=190:gx-=2px=190-pw#//////////////////////////
#SHOW Player
F(px,py,pw,ph,pc)F(px+4,py+5,3,6,"black")F(px+9,py+5,3,6,"black")#///////////////////////////
# PLAYER SHADOW..
ifpy+ph>=gy-ph:F(px,gy-2,pw,2,"black")#PLAYER outline
F(px,py,2,ph,"black")F(px+pw-2,py,2,ph,"black")F(px,py,pw,2,"black")F(px,py+ph-2,pw,2,"black")#///////////////////////
#/////GROUND////////////
F(gx,gy,gw,gh,gc)#///////////////////////
#rect
F(gx+rectx,gy-recty,rectw,recth,rectc)#rect outline
F(gx+rectx,gy-recty,3,recth,"black")F(gx+rectx+rectw-3,gy-recty,3,recth,"black")F(gx+rectx,gy-recty,rectw,3,"black")F(gx+rectx,gy-recty+recth-3,rectw,3,"black")F(gx+lava_x,lava_y,lava_w,lava_h,lava_c)#rect erase trail
F(gx+rectx-2,gy-recty,2,recth,bg)F(gx+rectx+rectw,gy-recty,2,recth,bg)#rect 2
F(gx+rect_2_x,gy-rect_2_y,rect_2_w,rect_2_h,rect_2_c)#rect 2 outline
F(gx+rect_2_x,gy-rect_2_y,3,rect_2_h,"black")F(gx+rect_2_x+rect_2_w-3,gy-rect_2_y,3,rect_2_h,"black")F(gx+rect_2_x,gy-rect_2_y,rect_2_w,3,"black")F(gx+rect_2_x,gy-rect_2_y+rect_2_h-3,rect_2_w,3,"black")#rect 2, erase trail
F(gx+rect_2_x-2,gy-rect_2_y,2,rect_2_h,bg)F(gx+rect_2_x+rect_2_w,gy-rect_2_y,2,rect_2_h,bg)#rect 3
F(gx+rect_3_x,gy-rect_3_y,rect_3_w,rect_3_h,rect_3_c)#rect 3 erase trail
F(gx+rect_3_x-2,gy-rect_3_y,2,rect_3_h,bg)F(gx+rect_3_x+rect_3_w,gy-rect_3_y,2,rect_3_h,bg)#rect 3 outline
F(gx+rect_3_x,gy-rect_3_y,3,rect_3_h,"black")F(gx+rect_3_x+rect_3_w-3,gy-rect_3_y,3,rect_3_h,"black")F(gx+rect_3_x,gy-rect_3_y,rect_3_w,3,"black")F(gx+rect_3_x,gy-rect_3_y+rect_3_h-3,rect_3_w,3,"black")#rect 4
F(gx+rect_4_x,gy-rect_4_y,rect_4_w,rect_4_h,rect_4_c)#rect 4, erase trail
F(gx+rect_4_x-2,gy-rect_4_y,2,rect_4_h,bg)F(gx+rect_4_x+rect_4_w,gy-rect_4_y,2,rect_4_h,bg)#rect 4 outline
F(gx+rect_4_x,gy-rect_4_y,3,rect_4_h,"black")F(gx+rect_4_x+rect_4_w-3,gy-rect_4_y,3,rect_4_h,"black")F(gx+rect_4_x,gy-rect_4_y,rect_4_w,3,"black")F(gx+rect_4_x,gy-rect_4_y+rect_4_h-3,rect_4_w,3,"black")#//// PLAYER "JUMP" ///////
ifkeydown(KEY_BACKSPACE)andjump_height<=7andp_on_platform:jump=Truep_score+=R(1,3)ifjump:js=3js-=1p_on_platform=Falsegravity=Falsepy-=jsF(px,py+ph,pw,3,bg)jump_height+=0.3ifjump_height>=22:jump_height=0jump=Falseifjump==False:gravity=True#////////////////////////////////////////////
ifgravity:gt=3gt-=1py+=gtF(px,py-2,pw,2,bg)ifpy+ph>gy:py=gy-php_on_platform=Trueifpx+pw>=gx+rectxandpx<=gx+rectx+rectwandpy+ph>=gy-rectyandpy+ph<=gy-recty+1:p_on_platform=Truepy=gy-recty-ph-1ifpx+pw>=gx+rect_2_xandpx<=gx+rect_2_x+rect_2_wandpy+ph>=gy-rect_2_yandpy+ph<=gy-rect_2_y+1:p_on_platform=Truepy=gy-rect_2_y-ph-1ifpx+pw>=gx+rect_3_xandpx<=gx+rect_3_x+rect_3_wandpy+ph>=gy-rect_3_yandpy+ph<=gy-rect_3_y+1:p_on_platform=Truepy=gy-rect_3_y-ph-1ifpx+pw>=gx+rect_4_xandpx<=gx+rect_4_x+rect_4_wandpy+ph>=gy-rect_4_yandpy+ph<=gy-rect_4_y+1:p_on_platform=Truepy=gy-rect_4_y-ph-1rect_4_x+=2gx-=2F(px-1,py,1,ph,bg)#///// PLAYER IS ABOVE //////
#erase rects
else:gy-=1ifgy<210:gy=210ifpx<=gx-98:px=gx-98F(px,py,1,ph,"cyan")else:F(gx-97,py,2,ph,bg)#player bends down or
ifkeydown(KEY_DOWN):# and p_on_platform:
F(px,py-14,pw,14,bg)ph=14py+=1else:ph=24#///PAUSE GAME/////
ifkeydown(KEY_OK):whilenotkeydown(KEY_VAR):draw_string("< PAUSED >",110,0)draw_string("[ Press [VAR] to resume ]",30,20)draw_string("",110,0,bg,bg)draw_string("",30,20,bg,bg)#"pipe"
F(gx+lava_x+100,gy-160,300,2,"black")#erase trail
F(gx+lava_x+98,gy-160,2,2,bg)F(gx+lava_x+400,gy-160,2,2,bg)#BULLET GOES LEFT FAST!
bullet_x-=3#SHOW BULLET
F(bullet_x,bullet_y,bullet_w,bullet_h,bullet_c)F(bullet_x+5,bullet_y+5,8,4,"red")F(bullet_x+bullet_w,bullet_y,3,bullet_h,bg)#BULLET OUTLINE
F(bullet_x,bullet_y,1,bullet_h,"blue")F(bullet_x+bullet_w-1,bullet_y,1,bullet_h,"blue")F(bullet_x,bullet_y,bullet_w,1,"blue")F(bullet_x,bullet_y+bullet_h-1,bullet_w,1,"blue")#RANDOMIIZE BULLET..
ifbullet_x+bullet_w<0-R(20,50):bullet_x=R(500,700)bullet_y=R(20,170)ifpx+pw>=bullet_xandpx<=bullet_x+bullet_wandpy+ph>=bullet_yandpy<=bullet_y+bullet_h:F(px,py,pw,ph,"red")F(px+pw,py,3,ph,bg)p_energy-=0.2px-=2#player on bullet
ifpx+pw>=bullet_xandpx<=bullet_x+bullet_wandpy+ph>=bullet_yandpy<=bullet_y+1:py=bullet_y-php_on_platform=True#******************************************************
ifkeydown(KEY_LEFT)andpx<154:px=154gx+=2#******************************************************
ifkeydown(KEY_RIGHT)andpx+pw>=168:px=168-pwgx-=2ifkeydown(KEY_UP):py-=6#player teleports to aa new game!
ifpx>=gx+area_x[2]:fromninjaimport*F(gx+lava_x-12,lava_y-15,12,40,"black")F(gx+lava_x+1,lava_y-15,2,40,bg)F(gx+lava_x-14,lava_y-15,2,40,bg)#DIFFERENT AREAS
F(gx+area_x[0],0,1000,190,"black")F(gx+area_x[1],0,2000,190,"orange")F(gx+area_x[2],0,3000,190,"blue")#****************************
F(gx+area_x[0]-3,0,3,gy,bg)F(gx+area_x[0],0,3,gy,"blue")F(gx+area_x[0]+1,0,3,gy,"blue")#player teleports!
ifpy<-1500:fromegor_2import*#//////[REMINDER]/////
T-=0.015ifT<0:game=FalseREMIND=Truewhilenotkeydown(KEY_EXE):draw_string(str(note),45,80)draw_string("Press [EXE] to resume game",10,200)ifkeydown(KEY_OK)andREMIND:fill_rect(0,0,322,222,(200,255,255))whilenotkeydown(KEY_EXE):draw_string("Hey, don't forget to:",30,20)F(0,50,322,2,"black")draw_string(str(note),45,70)F(0,160,322,2,"black")draw_string("Press [EXE] to resume game",10,200)F(0,0,322,222,bg)# REMIND=False
draw_string(chr(25)+":"+str(round(T)),2,2,(0,0,120),bg)
During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:
Ensure the proper functioning of the site (essential cookies); and
Track your browsing to send you personalized communications if you have created a professional account on the site and can be contacted (audience measurement cookies).
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.