sync on:sync rate 0
REM Shadow Ninja
INK RGB(140,0,0),0
CIRCLE 4,4,4
INK RGB(10,10,10),0
BOX 0,2,8,4
INK RGB(140,0,0),0
LINE 4,8,4,20
LINE 4,20,2,30
LINE 4,20,6,30
LINE 4,18,2,9
LINE 4,18,8,8
GET IMAGE 4,0,0,9,32
 
DIM enground#(5)
DIM enemyjp#(5)
DIM enemywfr#(5)
DIM endescent#(5)
DIM enemyy#(5)
DIM enemyx#(5)
DIM minenemyy#(1)
minenemyy#(1)=screen height()
foe=1
enemyy#(foe)=402
wait key
do
 CLS RGB(0,100,0)
 IF enground#(foe)=0 AND enemyjp#(foe)=0 THEN endescent#(foe)=endescent#(foe)+.05
 IF enground#(foe)=0 AND enemyjp#(foe)=0 THEN enemyy#(foe)=enemyy#(foe)+endescent#(foe)
 IF enground#(foe)=1 THEN endescent#(foe)=0
 IF enemyy#(foe)>=SCREEN HEIGHT()-33 THEN enground#(foe)=1 ELSE enground#(foe)=0 
 IF enemywfr#(foe)=1 AND enemyjp#(foe)=0 THEN enemywfr#(foe)=0:enemyjp#(foe)=5
 IF enemyjp#(foe)>0 THEN enemyjp#(foe)=enemyjp#(foe)-.1
 IF enemyjp#(foe)<0 THEN enemyjp#(foe)=0
 IF enemyy#(foe)<minenemyy#(foe) THEN minenemyy#(foe)=enemyy#(foe)
 IF enemyy#(foe)>=SCREEN HEIGHT()-33 THEN enground#(foe)=1 ELSE enground#(foe)=0
 IF enground#(foe)=1 THEN inair=1
 enemyy#(foe)=enemyy#(foe)-enemyjp#(foe)
 if mousex()>enemyx#(foe) then enemyx#(foe)=enemyx#(foe)+.1
 if mousex()<enemyx#(foe) then enemyx#(foe)=enemyx#(foe)-.1
 if spacekey()=1 and enemyjp#(foe)=0 and enemywfr#(foe)=0 then enemywfr#(foe)=1:enemyjp#(foe)=5
 IF enemywfr#(foe)=1 and SPACEKEY()=0 AND enemyjp#(foe)=0 THEN enemywfr#(foe)=0:enemyjp#(foe)=5
 paste image 4,enemyx#(foe),enemyy#(foe),1 
 SYNC
loop
 
 
 
 IF r=0 THEN  CLS RGB(0,100,0)
 ink rgb(0,80,0),0
 center text x#+5,y#-18,"P1" 
 IF RIGHTKEY()=1
  INC x#,1:move=1
  IF ground=1 THEN INC x#,.6
   if shiftkey()=1 and ground=1 and run>4
   inc x#,2
   dec run#,4
   dec run,4
  endif
 ENDIF
 IF LEFTKEY()=1
 
 DEC x#,1:move=2
 IF ground=1 THEN DEC x#,.6
  if shiftkey()=1 and ground=1 and run>4
   dec x#,2
   dec run#,4
   dec run,4
  endif
 ENDIF
 if run<100 then inc run#,.1
 run=run#
 if shiftkey()=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
 print "Run Energy:",run
 ink rgb(150,150,150),0
 print "Shot";
 if loopwait=0 then print " is available." else print " not available."
 SPRITE 1,x#,y#,move
 INK RGB(50,50,50),0
 IF r=0 THEN TEXT x#-2,y#-15,name$:INK RGB(255,255,255),0
 IF ground=0 AND jp#=0 THEN INC descent#,.05
 IF ground=0 AND jp#=0 THEN INC y#,descent#+default#
 IF ground=1 THEN descent#=0
 
 IF ground=1 THEN jumps=0
 IF wfr=1 and SPACEKEY()=0 AND jp#=0 THEN wfr=0:jp#=5
 IF jp#>0 THEN DEC jp#,.1
 IF jp#<0 THEN jp#=0
 DEC y#,jp#
 IF y#<miny# THEN miny#=y#
 IF y#>=SCREEN HEIGHT()-33 THEN ground=1 ELSE ground=0 
 
 
 IF ground=1 THEN inair=1
 IF SPACEKEY()=1 AND ground=1 THEN maxheighty#=y#-234.25:wfr=1