well, this code uses win32yabasic, from ezboard homebrew forums...
hope you guys and lovely guys enjoy! you'll need the emulator to run the game!
one problem.... the collision in the game does not work properly! for some reason, it lets some of the helicopter pass through the blocks...
and, the boss level at the end has not been coded, but all else works.
levels 1-9 are easy!
levels 10-14 are intermediate!!!
and, levels 15-19 are extreme!
if someone thinks that the game is too hard, then i will make it easier when i code the boss and fix the collision!
Cheers,
   Sir Johnah (Clanky)
>_<
THIS IS UPDATED!!! NEWER VERSION... NEW BITS OF CODE IMPLEMENTED!!!
Hope you enjoy
'Green Boxcopter
'Coded by Sir Johnah
'Rel-Ver: 15.09.06
'Add_Rel-Ver: 20.09.06, CCX: Slinking Shadow
'INTRODUCTION
'========
'Avoid the blocks scrolling across the screen
'or else you will crash!!! Do not hit the roof
'or the ground, or, again, you will crash.
'NB// ROOF REFERS TO THE top white bit.
'NB// GROUND REFERS TO THE bottom white bit.
'CONTROLS
'========
'D-PAD UP: Fly helicopter up
'D-PAD DOWN: Fly helicopter down
'START: Pause Game
'X (while paused): Unpause Game
'NB// NO OTHER BUTTONS ARE USED IN-GAME,
' EXCEPT FOR MENU SELECTIONS.
'Add_Rel-Ver: 20.09.06
'=====================
'New Code:
' Level 10-New Block Formation, Chatter Motion
' Level 15-New Block Formation, Up/Down Motion
' Level 20-Boss Level!!!
'Hope you enjoy the game.
'Cheers, Sir Johnah
'>_<
open window 640,512
high_score=1000
title()
'TITLE PAGE
sub title()
xp=80
yp=256
spd=3
repeat
setdrawbuf db
db=1-db
setdispbuf db
clear window
setrgb 1,100,200,100
text 245,100,"Green Boxcopter"
text 230,120,"Coded by Sir Johnah"
text 235,200,"Hit X to Play Game"
text 225,380,"{DANce tO my TRanCE}"
draw()
clear fill rect 0,475,640,500
until (peek("port1")=16384)
setup()
end sub
'SET VARIABLES
sub setup()
score=0
hi=0
stage=0
level=1
stage=0
grav=0
xp=80
yp=256
spd=5
ex1=650
ey1=int(ran(382)+100)
size1=int(ran(50)+50)
ex1s=1
ex2=960
ey2=int(ran(382)+100)
size2=int(ran(50)+50)
ex2s=2
smoke1=0
smoke2=0
smoke3=0
main()
end sub
'GAME LOOP
sub main()
label loop
setdrawbuf db
db=1-db
setdispbuf db
clear window
score=score+0.1
if level<10 level()
if (level>=10 and level<15) level_b10()
if (level>=15 and level<20) level_b15()
if level=20 boss()
if level<20 stage=stage+0.1
'GET LEVEL VARS
if stage>=100 then
stage=0
score=score+50
spd=spd+0.25
level=level+1
fi
rise=0
'CALL ROUTINES
controls()
level()
chk_sum()
draw()
'GRAVITY
if rise=0 then
grav=grav+.69
up=0
fi
if rise=1 then
grav=0
up=up+.69
fi
yp=yp+grav
goto loop
end sub
sub draw()
'DRAW SMOKE
if smoke1=0 then
sx1=xp-30
sy1=yp
smoke1=1
elsif smoke1=1 then
sx1=sx1-spd
setrgb 1,100,100,100
fill circle sx1-10,sy1,5
setrgb 1,140,140,140
fill circle sx1-3,sy1-3,5
setrgb 1,120,120,120
fill circle sx1-3,sy1+3,5
if sx1<=0 smoke1=0
if sx1<=10 smoke2=0
fi
if smoke2=0 then
sx2=xp-30
sy2=yp
smoke2=1
elsif smoke2=1 then
sx2=sx2-spd
setrgb 1,100,100,100
fill circle sx2-10,sy2,5
setrgb 1,140,140,140
fill circle sx2-3,sy2-3,5
setrgb 1,120,120,120
fill circle sx2-3,sy2+3,5
if sx2<=5 smoke2=0
if sx2<=10 smoke3=0
fi
if smoke3=0 then
sx3=xp-30
sy3=yp
smoke3=1
elsif smoke3=1 then
sx3=sx3-spd
setrgb 1,100,100,100
fill circle sx3-10,sy3,5
setrgb 1,140,140,140
fill circle sx3-3,sy3-3,5
setrgb 1,120,120,120
fill circle sx2-3,sy3+3,5
if sx3<=5 smoke3=0
fi
'PLAYER HELICOPTER
setrgb 1,100,200,100
rect xp-10,yp-10,xp+10,yp+10
rect xp-10,yp-2.5,xp-35,yp+2.5
rect xp-35,yp-6,xp-42,yp+3
line xp-8,yp+10,xp-8,yp+15
line xp+8,yp+10,xp+8,yp+15
line xp-12,yp+15,xp+12,yp+15
rect xp-2,yp-10,xp+2,yp-15
rect xp+10,yp-10,xp+3,yp+3
dot xp-42,yp+3
dot xp+3,yp+3
if rotated=0 rotate=rotate+5
if rotated=1 rotate=rotate-5
if rotate=30 or rotate=0 rotated=1-rotated
line xp-rotate,yp-15,xp+rotate,yp-15
'DRAW GROUND/ROOF
setrgb 1,250,250,250
fill rect 0,0,640,24
fill rect 0,417,640,512
'DRAW TABLE
clear fill rect 0,475,640,500
'SCORE
setrgb 1,100,200,100
text 10,490,"SCORE: "+str$(int(score))
if score>high_score then
high_score=int(score)
hi=1
fi
text 200,490,"HIGH SCORE: "+str$(high_score)
'DRAW LEVEL VARS
text 520,490,"LEVEL: "+str$(level)+"."+str$(int(stage/10))
setrgb 1,0,90,0
setrgb 2,0,90,0
setrgb 3,100,200,100
gtriangle 410,482 to 410+stage,482 to 410+stage,493
setrgb 2,100,200,100
gtriangle 410,482 to 410,493 to 410+stage,493
setrgb 1,0,0,0
line 420,482,420,493
line 430,482,430,493
line 440,482,440,493
line 450,482,450,493
line 460,482,460,493
line 470,482,470,493
line 480,482,480,493
line 490,482,490,493
line 500,482,500,493
setrgb 1,250,250,250
rect 410,482,510,493
dot 510,482
end sub
sub level()
'GET LEVEL BLOCKS
'FIRST BLOCK
if ex1<=0 ex1s=1
if ex1s=1 then
ex1=650
ey1=int(ran(382)+100)
size1=int(ran(50)+50)
ex1s=2
elsif ex1s=2 then
ex1=ex1-spd
fi
'SECOND BLOCK
if ex2<=0 ex2s=1
if ex2s=1 then
ex2=650
ey2=int(ran(382)+100)
size2=int(ran(50)+50)
ex2s=2
elsif ex2s=2 then
ex2=ex2-spd
fi
'DRAW LEVEL BLOCKS
setrgb 1,250,250,250
fill rect ex1-5,ey1-size1,ex1+5,ey1+size1
fill rect ex2-5,ey2-size2,ex2+5,ey2+size2
end sub
sub level_b10()
'GETTING GOOD HEY? MUST THINK TO BEAT YOU!!!
'GET LEVEL BLOCKS
'FIRST BLOCK
if ex1<=0 ex1s=1
if ex1s=1 then
ex1=650
ey1=int(ran(382)+100)
size1=int(ran(50)+50)
ex1s=2
elsif ex1s=2 then
dirx1=int(ran(2))
if dirx1=0 drx1=spd
if dirx1=1 drx1=-spd
ex1=ex1-spd
ey1=ey1-drx1
fi
'SECOND BLOCK
if ex2<=0 ex2s=1
if ex2s=1 then
ex2=650
ey2=int(ran(382)+100)
size2=int(ran(50)+50)
ex2s=2
elsif ex2s=2 then
dirx2=int(ran(2))
if dirx2=0 drx2=spd
if dirx2=1 drx2=-spd
ex2=ex2-spd
ey2=ey2-drx2
fi
'DRAW LEVEL BLOCKS
setrgb 1,250,250,250
fill rect ex1-5,ey1-size1,ex1+5,ey1+size1
fill rect ex2-5,ey2-size2,ex2+5,ey2+size2
end sub
sub level_b15()
'DAMN, SMART GUY EY'? YOU WONT BEAT ME ANYMORE
'GET LEVEL BLOCKS
'FIRST BLOCK
if ex1<=0 ex1s=1
if ex1s=1 then
ex1=650
ey1=int(ran(382)+100)
size1=int(ran(50)+50)
ex1s=2
dirx1=int(ran(2))
elsif ex1s=2 then
if dirx1=0 drx1=spd
if dirx1=1 drx1=-spd
ex1=ex1-spd
ey1=ey1-drx1
if (ey1-size1)<=24 dirx1=1
if (ey1+size1)>=417 dirx1=0
fi
'SECOND BLOCK
if ex2<=0 ex2s=1
if ex2s=1 then
ex2=650
ey2=int(ran(382)+100)
size2=int(ran(50)+50)
ex2s=2
dirx2=int(ran(2))
elsif ex2s=2 then
if dirx2=0 drx2=spd
if dirx2=1 drx2=-spd
ex2=ex2-spd
ey2=ey2-drx2
if (ey2-size2)<=24 dirx2=1
if (ey2+size2)>=417 dirx2=0
fi
'DRAW LEVEL BLOCKS
setrgb 1,250,250,250
fill rect ex1-5,ey1-size1,ex1+5,ey1+size1
fill rect ex2-5,ey2-size2,ex2+5,ey2+size2
end sub
sub boss()
'WELL....
'I CHALLENGE YOU TO A DUEL!!!
'FIGHT ME AND WIN, AND I SHALL LET YOU LIVE... BUT,
'FIGHT AND LOSE! THEN I SHALL TEAR YOU APART!!!
end sub
sub chk_sum()
'CHECK SYSTEM
if yp<=40 crash()
if yp>=402 crash()
'=============
'=PROBLEMS!!!=
'=============
'COLLISION FIRST BLOCK
if (yp-15>=(ey1-size1) and yp+15<=(ey1+size1) and xp+30>=(ex1-5) and xp-42<=(ex1+5)) crash()
'COLLISION SECOND BLOCK
if (yp-15>=(ey2-size2) and yp+15<=(ey2+size2) and xp+30>=(ex2-5) and xp-42<=(ex2+5)) crash()
end sub
sub crash()
label crash
setdrawbuf db
db=1-db
setdispbuf db
smoke1=3
smoke2=3
smoke3=3
draw()
setrgb 1,200,10,10
clear fill circle xp,yp,53
fill circle xp,yp,50
setrgb 1,100,200,100
clear fill rect 190,185,415,270
rect 190,185,415,270
text 225,200,"Hit X to Restart"
text 200,220,"Hit TRIANGLE to Quit"
text 200,240,"SCORE: "+str$(int(score))
text 200,260,"LEVEL: "+str$(level)+"."+str$(int(stage/10))
setrgb 1,200,200,200
rect 192,187,413,268
setrgb 1,100,200,100
line 190,227,415,227
setrgb 1,int(ran(250)+120),int(ran(250)+120),int(ran(250)+120)
if hi=1 then
clear fill rect 140,305,470,330
rect 140,305,470,330
text 150,320,"CONGRADULATIONS! NEW HIGH SCORE"
fi
if peek("port1")=16384 title()
if peek("port1")=4096 error"Thank you for playing Green Boxcopter, coded by Sir Johnah.\nHope you enjoyed this installment!\nCheers, Sir Johnah\n>_<\n"
goto crash
end sub
sub controls()
'GET PLAYER CONTROLS
c=peek("port1")
if and(c,64)<>0 then
yp=yp+(4+up)
rise=1
fi
if and(c,16)<>0 then
yp=yp-(4+up)
rise=1
fi
if and(c,8)<>0 pausing()
end sub
sub pausing()
ex1p=ex1
ey1p=ey1
ex2p=ex2
ey2p=ey2
smoke1=3
smoke2=3
smoke3=3
label pausing
ex1=ex1p
ey1=ey1p
ex2=ex2p
ey2=ey2p
setdrawbuf db
db=1-db
setdispbuf db
draw()
level()
setrgb 1,100,200,100
clear fill rect 190,185,415,230
rect 190,185,415,230
text 218,210,"Hit X to Continue"
setrgb 1,200,200,200
rect 192,187,413,228
if peek("port1")=16384 then
smoke1=0
smoke2=0
smoke3=0
main()
fi
goto pausing
end sub
Edit- Added Code Tags To Source Listing