#WRITTEN BY: WILSON
frommathimport*fromrandomimport*fromkandinskyimport*fromrandomimportrandintasRfromrandomimportchoiceasCHfromkandinskyimportfill_rectasFfromkandinskyimportdraw_stringasSTRfromionimport*fromtimeimport*#******************************************************
alive=Truegravity=Truep_on_bullet=False#******************************************************
bg="white"fuel=3#******************************************************
p_on_platform=Truep_face_left=Falsep_face_right=Trueammo=35shoot_rght=Falseshoot_left=Falsep_energy=35px=154py=170pw=14ph=20pc=(0,0,100)shoot=Falsebull=[0]bull_y=py+10bull[0]=pxbull_w=10bull_h=5#******************************************************
gx=0gy=190gw=3000gh=3gc=(0,100,0)#ground color
gc_main=CH(['brown','pink','orange','gray'])#******************************************************
cl_1_x=gx+R(400,700)cl_1_y=R(0,50)cl_1_w=R(35,70)cl_1_h=R(10,25)cl_1_c="white"#******************************************************
cl_2_x=gx+R(400,700)cl_2_y=R(0,50)cl_2_w=R(35,70)cl_2_h=R(10,25)cl_2_c="white"#******************************************************
bu_x=R(500,700)bu_y=R(20,150)bu_w=30bu_h=12bu_c='black'#******************************************************
bu_2_x=R(500,700)bu_2_y=R(20,150)bu_2_w=40bu_2_h=16bu_2_c='black'crit_x=[gx+R(700,1000),gx+R(1200,1500),gx+R(2000,2500),gx+R(3000,3400),gx+R(3600,4000),gx+R(4200,5000)]crit_w=25crit_h=8crit_y=gy-crit_h#******************************************************
lava_x=[gx+R(800,1000),gx+R(1100,1300),gx+R(1400,1600)]lava_w=50lava_h=10lava_y=gy#****************
plat_x=[gx+R(700,900),gx+R(1200,1500),gx+R(1700,1900),gx+R(2200,2400),gx+R(2600,3500),gx+R(3800,4200)]plat_w=R(400,700)plat_h=10plat_y=R(80,120,)plat_c=(R(0,255),R(0,255),R(0,255))#****************
#******************************************************
r_1_x=gx+R(250,500)r_1_w=gx+R(100,500)r_1_h=gx+R(40,120)r_1_y=gy-r_1_hr_1_c=CH(['blue','red','green','yellow','brown','black','orange','purple'])#******************************************************
area_x=[gx+1500,gx+2500,gx+4500]#******************************************************
F(0,0,322,222,bg)F(0,190,322,5,(0,R(50,255),0))#******************************************************
game=Truewhilep_energy>0:F(0,190,322,2,(0,100,0))F(0,193,322,1000,gc_main)F(gx+r_1_x,gy-r_1_h,r_1_w,r_1_h,r_1_c)#******************************************************
#RECT OUTLINE
F(gx+r_1_x,r_1_y,2,r_1_h,"black")F(gx+r_1_x+r_1_w-2,r_1_y,2,r_1_h,"black")F(gx+r_1_x,r_1_y,r_1_w,2,"black")F(gx+r_1_x,r_1_y+r_1_h-2,r_1_w,2,"black")#******************************************************
#erase
F(gx+r_1_x-3,gy-r_1_h,3,r_1_h,bg)F(gx+r_1_x+r_1_w+1,gy-r_1_h,3,r_1_h,bg)#******************************************************
F(gx+lava_x[0],lava_y,lava_w,lava_h,"red")F(gx+lava_x[1],lava_y,lava_w,lava_h,"red")F(gx+lava_x[2],lava_y,lava_w,lava_h,"red")#******************************************************
F(gx+plat_x[0],plat_y,plat_w,plat_h,plat_c)F(gx+plat_x[1],plat_y,plat_w,plat_h,plat_c)F(gx+plat_x[2],plat_y,plat_w,plat_h,plat_c)F(gx+plat_x[3],plat_y,plat_w,plat_h,plat_c)F(gx+plat_x[4],plat_y,plat_w,plat_h,plat_c)F(gx+plat_x[5],plat_y,plat_w,plat_h,plat_c)#erase left right trail
F(gx+plat_x[0]-3,plat_y,3,plat_h,bg)F(gx+plat_x[1]-3,plat_y,3,plat_h,bg)F(gx+plat_x[2]-3,plat_y,3,plat_h,bg)F(gx+plat_x[3]-3,plat_y,3,plat_h,bg)F(gx+plat_x[4]-3,plat_y,3,plat_h,bg)F(gx+plat_x[5]-3,plat_y,3,plat_h,bg)F(gx+plat_x[0]+plat_w+1,plat_y,3,plat_h,bg)F(gx+plat_x[1]+plat_w+1,plat_y,3,plat_h,bg)F(gx+plat_x[2]+plat_w+1,plat_y,3,plat_h,bg)F(gx+plat_x[3]+plat_w+1,plat_y,3,plat_h,bg)F(gx+plat_x[4]+plat_w+1,plat_y,3,plat_h,bg)F(gx+plat_x[5]+plat_w+1,plat_y,3,plat_h,bg)#*****************************
F(gx+crit_x[0],gy-crit_h,crit_w,crit_h,"black")F(gx+crit_x[1],gy-crit_h,crit_w,crit_h,"black")F(gx+crit_x[2],gy-crit_h,crit_w,crit_h,"black")F(gx+crit_x[3],gy-crit_h,crit_w,crit_h,"black")F(gx+crit_x[4],gy-crit_h,crit_w,crit_h,"black")F(gx+crit_x[5],gy-crit_h,crit_w,crit_h,"black")F(gx+crit_x[0]-3,gy-crit_h,3,crit_h,bg)F(gx+crit_x[0]+crit_w+1,gy-crit_h,3,crit_h,bg)F(gx+crit_x[1]-3,gy-crit_h,3,crit_h,bg)F(gx+crit_x[1]+crit_w+1,gy-crit_h,3,crit_h,bg)F(gx+crit_x[2]-3,gy-crit_h,3,crit_h,bg)F(gx+crit_x[2]+crit_w+1,gy-crit_h,3,crit_h,bg)F(gx+crit_x[3]-3,gy-crit_h,3,crit_h,bg)F(gx+crit_x[3]+crit_w+1,gy-crit_h,3,crit_h,bg)F(gx+crit_x[4]-3,gy-crit_h,3,crit_h,bg)F(gx+crit_x[4]+crit_w+1,gy-crit_h,3,crit_h,bg)F(gx+crit_x[5]-3,gy-crit_h,3,crit_h,bg)F(gx+crit_x[5]+crit_w+1,gy-crit_h,3,crit_h,bg)#crit_x[0] eyes
F(crit_x[0]+3,gy-crit_h+3,10,5,"red")#*****************************
#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,"pink")#*****************************
#***[ PLAYER TELEPORTS TO ]***
# A NEW WORLD OR DIMENSION!!
ifpx>=gx+area_x[2]+2000:fromegor_1import*#*****************************
F(gx+area_x[0],0,3,190,"blue")F(gx+area_x[0]-3,0,3,190,bg)F(gx+area_x[0]+1000+1,0,3,190,bg)#*****************************
#////PLAYER/////
F(px,py,pw,ph,pc)#player OUTLINE
F(px,py,1,ph,"black")F(px+pw-1,py,1,ph,"black")F(px,py,pw,1,"black")F(px,py+ph-1,pw,1,"black")#PLAYER FACE/SKIN
F(px+2,py+4,10,4,"orange")#player eyes
F(px+4,py+5,2,2,"black")F(px+9,py+5,2,2,"black")#player mouth
F(px+3,py+9,8,1,"black")#player footware
F(px,py+ph-2,pw,2,"brown")#**************************
#PLAYER ON DIFFERENT PLATFORMS
foriinplat_x:ifpx+pw>=gx+iandpx<=gx+i+plat_wandpy+ph>=plat_yandpy<=plat_y+2:py=plat_y-php_on_platform=Truefuel=3#******************************************************
# i is lava x values (locations)
# for each lava point.
foriinlava_x:ifpx+pw>=gx+iandpx<=gx+i+lava_wandpy+ph>=lava_yandpy<=lava_y+lava_h:F(px,py,pw,ph,"red")p_energy-=0.1sleep(0.005)#******************************************************
foriinlava_x:F(gx+i+lava_w+1,0,2,lava_h,bg)F(gx+i-2,0,2,lava_h,bg)#******************************************************
foriincrit_x:ifpx+pw>=gx+iandpx<=gx+i+crit_wandpy+ph>=crit_yandpy<=crit_y+crit_h:F(px,py,pw,ph,"red")p_energy-=0.1F(px,py-8,round(p_energy/2),4,"red")F(px+round(p_energy/2),py-8,2,4,bg)F(px,py-8,round(p_energy/2),1,"black")F(px,py-8+4-1,round(p_energy/2),1,"black")#******************************************************
bu_x-=2bu_2_x-=2#SHOW BULLET
F(bu_x,bu_y,bu_w,bu_h,bu_c)F(bu_x+5,bu_y+5,8,4,"red")F(bu_x+bu_w,bu_y,3,bu_h,bg)#BULLET OUTLINE
F(bu_x,bu_y,1,bu_h,"blue")F(bu_x+bu_w-1,bu_y,1,bu_h,"blue")F(bu_x,bu_y,bu_w,1,"blue")F(bu_x,bu_y+bu_h-1,bu_w,1,"blue")#******************************************************
#RANDOMIIZE BULLET..
ifbu_x+bu_w<0-R(20,80):bu_x=R(500,600)bu_y=py#SHOW BULLET 2
F(bu_2_x,bu_2_y,bu_2_w,bu_2_h,bu_2_c)F(bu_2_x+5,bu_2_y+5,8,4,"green")F(bu_2_x+bu_2_w,bu_2_y,3,bu_2_h,bg)F(bu_2_x,bu_2_y,1,bu_2_h,"magenta")F(bu_2_x+bu_2_w-1,bu_2_y,1,bu_2_h,"magenta")F(bu_2_x,bu_2_y,bu_2_w,1,"magenta")F(bu_2_x,bu_2_y+bu_2_h-1,bu_2_w,1,"magenta")#RANDOMIIZE BULLET 2
ifbu_2_x+bu_2_w<0-R(20,50):bu_2_x=R(600,800)bu_2_y=py#******************************************************
#///PAUSE GAME/////
ifkeydown(KEY_OK):whilenotkeydown(KEY_VAR):draw_string("< PAUSED >",110,0)draw_string("[ Press [VAR] to resume ]",30,20)draw_string("Your Location:"+str(px-gx)+","+str(py+ph),40,60)draw_string("",110,0,bg,bg)draw_string("",30,20,bg,bg)draw_string("Your Location: ",40,60,bg,bg)#******************************************************
#player bends down or
ifkeydown(KEY_DOWN):# and p_on_platform:
F(px,py-10,pw,10,bg)ph=10py+=1else:ph=20ifpy+ph>=gy:py=gy-ph#******************************************************
ifkeydown(KEY_BACKSPACE)andfuel>0:F(px,py+ph+1,pw,4,bg)py-=4fuel-=0.048#******************************************************
iffuel<=0:fuel=0#******************************************************
ifpy+ph>=190:p_on_platform=Truefuel=3ifgravity:py+=2F(px,py-2,pw,2,bg)#******************************************************
ifpx+pw>=bu_xandpx<=bu_x+bu_wandpy+ph>=bu_yandpy<=bu_y+bu_h:F(px,py,pw,ph,"red")F(px+pw,py,3,ph,bg)p_energy-=0.2px-=2#******************************************************
ifpx+pw>=bu_xandpx<=bu_x+bu_wandpy+ph>=bu_yandpy+ph<=bu_y+2:py=bu_y-php_on_platform=Truefuel=3F(px+pw+1,py,2,ph,bg)p_on_bullet=Trueelse:p_on_bullet=Falseifpx+pw>=bu_2_xandpx<=bu_2_x+bu_2_wandpy+ph>=bu_2_yandpy<=bu_2_y+bu_2_h:F(px,py,pw,ph,(120,0,0))F(px+pw,py,3,ph,bg)p_energy-=0.2px-=3ifpx+pw>=bu_2_xandpx<=bu_2_x+bu_2_wandpy+ph>=bu_2_yandpy+ph<=bu_2_y+2:py=bu_2_y-php_on_platform=Truefuel=3F(px+pw+1,py,2,ph,bg)p_on_bullet=Trueelse:p_on_bullet=False#******************************************************
ifpx+pw>=gx+r_1_xandpx<=gx+r_1_x+r_1_wandpy+ph>=r_1_yandpy+ph<=r_1_y+2:py=r_1_y-php_on_platform=Truefuel=3#******************************************************
ifkeydown(KEY_LEFT):px-=3F(px+pw,py,3,ph,bg)p_face_left=Truep_face_right=Falseifkeydown(KEY_RIGHT):px+=3F(px-3,py,3,ph,bg)p_face_right=Truep_face_left=False#******************************************************
ifkeydown(KEY_LEFT)andkeydown(KEY_TOOLBOX):px-=5F(px+pw+1,py,5,ph,bg)#******************************************************
ifkeydown(KEY_RIGHT)andkeydown(KEY_TOOLBOX):px+=5F(px-5,py,5,ph,bg)#******************************************************
ifkeydown(KEY_LEFT)andpx<154:px=154gx+=3#******************************************************
ifkeydown(KEY_RIGHT)andpx+pw>=168:px=168-pw# F(px+pw,py,3,ph,bg)
gx-=3#******************************************************
#limit to the left
ifpx<=gx-300:px=gx-300F(gx-300,0,2,190,"cyan")whilenotkeydown(KEY_RIGHT):STR("You are not ready for",4,20)STR("what is beyond here..",4,40)STR("A wise man named Rygar will",4,60)STR("guide you. He lives in a",4,80)STR("village Eastward..",4,100)STR("",4,20,bg,bg)STR("",4,40,bg,bg)STR("",4,60,bg,bg)STR("",4,80,bg,bg)STR("",4,100,bg,bg)F(gx-300,0,2,190,bg)px=gx-297#******************************************************
ifpx<=120andp_on_bullet:px=120gx+=3#******************************************************
ifpx+pw>=200andp_on_bullet:px=200-pwgx-=3#******************************************************
ifpy+ph<190:p_on_platform=False#***************************
#CLOUD 1
F(cl_1_x,cl_1_y,cl_1_w,cl_1_h,cl_1_c)F(cl_1_x+cl_1_w+1,cl_1_y,2,cl_1_h,bg)#******************************************************
#CLOUD 1 outline
F(cl_1_x,cl_1_y,2,cl_1_h,"cyan")F(cl_1_x+cl_1_w-2,cl_1_y,2,cl_1_h,"cyan")F(cl_1_x,cl_1_y,cl_1_w,2,"cyan")F(cl_1_x,cl_1_y+cl_1_h-2,cl_1_w,2,"cyan")#******************************************************
#CLOUD moves
cl_1_x-=CH([0,1,2])ifcl_1_x+cl_1_w<0-R(20,50):cl_1_x=R(400,500)cl_1_y=R(0,60)cl_1_w=R(30,70)cl_1_h=R(10,30)#******************************************************
#CLOUD 2
F(cl_2_x,cl_2_y,cl_2_w,cl_2_h,cl_2_c)F(cl_2_x+cl_2_w+1,cl_2_y,2,cl_2_h,bg)#******************************************************
#CLOUD 2 outline
F(cl_2_x,cl_2_y,2,cl_2_h,"cyan")F(cl_2_x+cl_2_w-2,cl_2_y,2,cl_2_h,"cyan")F(cl_2_x,cl_2_y,cl_2_w,2,"cyan")F(cl_2_x,cl_2_y+cl_2_h-2,cl_2_w,2,"cyan")#******************************************************
#CLOUD 2 moves
cl_2_x-=CH([0,1])#******************************************************
ifcl_2_x+cl_2_w<0-R(20,50):cl_2_x=R(400,500)cl_2_y=R(0,60)cl_2_w=R(30,60)cl_2_h=R(10,20)#******************************************************
crit_x[0]-=CH([-2,-1,1])crit_x[1]-=CH([-1,1,2])crit_x[2]-=CH([-2,1])crit_x[3]-=CH([-2,-1,1])crit_x[4]-=CH([-1,1,2])crit_x[5]-=CH([-2,1])ifkeydown(KEY_TOOLBOX)andammo>0andp_face_right:F(px+pw+1,py+9,20,3,"black")F(px+pw+8,py+7,2,8,"gray")sleep(0.01)F(px+pw+1,py+9,20,3,bg)F(px+pw+8,py+7,2,8,bg)F(gx+plat_x[0],plat_y,2,plat_h,"black")F(gx+plat_x[0]+plat_w-2,plat_y,2,plat_h,"black")F(gx+plat_x[0],plat_y,plat_w,2,"black")F(gx+plat_x[0],plat_y+plat_h-2,plat_w,2,"black")F(0,0,322,222,"black")STR("GAME OVER",100,100,"orange","black")
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.