Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on March 07, 2008
-
Stonemonkeys F1 game is classy - good to look at, hard to play.
I think I'll stick to something simple.
move the bat to hit the 'balls' back up - bat will grow when you do and smaller when you miss.
game will halt and score will show when bat is too small.
open window 640,512
blox=10
dim enx(blox),eny(blox),m(blox),go(blox)
for a=1 to blox
enx(a)=int(ran(600))+20
eny(a)=int(ran(300))
go(a)=ran(0.1)+0.1
next a
hmx=300
hmy=500
bt=30
hmm=0
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
hmm=0
c=peek("port1")
if and(c,128)>0 hmm=-10
if and(c,32)>0 hmm=10
hmx=hmx+hmm
if hmx<0+bt hmx=0+bt
if hmx>640-bt hmx=640-bt
setrgb 1,100,250,100
fill rectangle 0,0 to 640,512
for a=1 to blox
m(a)=m(a)+go(a)
eny(a)=eny(a)+m(a)
if eny(a)>520 then
bt=bt-0.5
m(a)=0
enx(a)=int(ran(600))+20
eny(a)=int(ran(20))-30
endif
if enx(a)>hmx-bt and enx(a)<hmx+bt and eny(a)>hmy then
score=score+1
bt=bt+1
m(a)=-m(a)*.9
eny(a)=hmy-10
endif
if bt<10 then
go(a)=0
m(a)=0
text 280,260,"score "+str$(score)
endif
setrgb 1,200,200,0
fill rectangle enx(a)-5,eny(a)-5 to enx(a)+5,eny(a)+5
setrgb 1,0,0,0
rectangle enx(a)-5,eny(a)-5 to enx(a)+5,eny(a)+5
next a
setrgb 1,200,100,0
fill rectangle hmx-bt,hmy-5 to hmx+bt,hmy+5
setrgb 1,0,0,0
rectangle hmx-bt,hmy-5 to hmx+bt,hmy+5
until (1=0)
-
Neat idea sort of one player pong with gravity. The paddles grow when you bounce one too. Sweet
-
Nice one! Love the 'warm' colours.
Got my bat to the size of the width of the screen... :|
Didn't last long either ;)
Could you make it so their are levels? Once your bat gets a certain width, gain a level. Each level could increase speed, and maybe you could have special pick-ups: say, anti-gravity, increased bat speed... etc. And you could have penalty balls: say, balls which take away large amounts of bat, or maybe split your bat where it hits (you end up with the larger part of the bat, the smaller bit falls away)...
Great stuff :)