You can select the difficulty level before you start.
AIM:
Get as many points as you can.
HOW:
Stop the ball from going past your hitter and get it to go past the computer's hitter. Move while the ball is being hit to knock it sideways/up and down.
CONTROLS:
The hitter moves with the mouse.
EXTRA:
If the ball hits the edge of the hitter it will skim off to the side.
Long code:
set window on : set window position 150,80
set camera fov 3.14/5
set display mode 600,600,32
set camera view 0,0,600,600
autocam off
move camera -200
enable tnl
sync on : sync rate 30
hide mouse
print "1 : Unbeatable"
print "2 : Unbeaten"
print "3 : Super hard"
print "4 : Very hard"
print "5 : Hard"
print "6 : Less hard"
print "7 : Medium"
print "8 : Easy"
print "9 : Easier"
print "10: Very easy"
print "11: Extra easy"
print "12: Super easy"
print "13: Too easy"
print "14: Unloseable"
print "15: Slower than a sloth"
input "Enter difficulty level(Decimals allowed): ",spd#
if spd# < 1 then spd# = 1
make object box 1,100,100,500
color object 1,rgb(255,0,0)
make object box 2,20,20,5
color object 2,rgb(0,150,0)
make object box 3,20,20,5
color object 3,rgb(0,0,255)
fade object 3,500
ghost object on 3
make object sphere 4,5
color object 4,rgb(255,255,0)
set object 4,1,1,1,1,0
set object 2,1,1,1,1,0
set object 1,1,1,0,1,1,1,1
dim hx#(2)
dim hy#(2)
zmo# = -2
bz# = 200
do
mmox3#=mmox2#
mmox2#=mmox1#
mmox1#=mousemovex()
mmoy3#=mmoy2#
mmoy2#=mmoy1#
mmoy1#=mousemovey()
tx#=((mmox1#+mmox2#+mmox3#)/3)
ty#=((mmoy1#+mmoy2#+mmoy3#)/3)
hx#(1) = (mousex()/6)-50
hy#(1) = 50-(mousey()/6)
position object 4,bx#,by#,bz#
position object 3,hx#(1),hy#(1),-45
position object 2,hx#(2),hy#(2),240
inc bx#,xmo#
inc by#,ymo#
inc bz#,zmo#
if bz# < -42 and bz# > -46
distx# = bx#-hx#(1)
disty# = by#-hy#(1)
if abs(distx#) < 12.5 and abs(disty#) < 12.5
if abs(distx#) > 10
if distx# > 0
inc xmo#,(distx#-10)
else
inc xmo#,(distx#+10)
endif
endif
if abs(disty#) > 10
if disty# > 0
inc ymo#,(disty#-10)
else
inc ymo#,(disty#+10)
endif
endif
zmo# = (0-zmo#)
inc bz#,zmo#
inc xmo#,tx#/3
dec ymo#,ty#/3
endif
endif
if bz# > 235 and bz# < 245
distx# = bx#-hx#(2)
disty# = by#-hy#(2)
if abs(distx#) < 12.5 and abs(disty#) < 12.5
if abs(distx#) > 10
if distx# > 0
inc xmo#,(distx#-10)
else
inc xmo#,(distx#+10)
endif
endif
if abs(disty#) > 10
if disty# > 0
inc ymo#,(disty#-10)
else
inc ymo#,(disty#+10)
endif
endif
zmo# = (0-zmo#)
inc bz#,zmo#
inc xmo#,(hx#(2)-oldx#)/3
dec ymo#,(hy#(2)-oldy#)/3
endif
endif
if bx# < -47.5
xmo# = abs(xmo#)
endif
if by# < -47.5
ymo# = abs(ymo#)
endif
if bx# > 47.5
xmo# = 0-abs(xmo#)
endif
if by# > 47.5
ymo# = 0-abs(ymo#)
endif
oldx# = hx#(2)
oldy# = hy#(2)
hx#(2) = curvevalue(bx#,hx#(2),spd#)
hy#(2) = curvevalue(by#,hy#(2),spd#)
ink rgb(255,255,255),0
line 0,0,197,197
line 197,197,197,402
line 0,599,197,402
line 197,402,402,402
line 197,197,402,197
line 402,197,599,0
line 402,197,402,402
line 402,402,599,599
ink rgb(255,0,255),0
t# = (((bz#+45)*197)/285)
line t#,t#,600-t#,t#
line 600-t#,t#,600-t#,600-t#
line t#,t#,t#,600-t#
line t#,600-t#,600-t#,600-t#
tx = object screen x(4)
ty = object screen y(4)
ink rgb(0,255,255),0
line tx,t#,tx,600-t#
line t#,ty,600-t#,ty
ink rgb(0,255,0),0
text 0,0,"Fps: "+str$(screen fps())
text 0,20,"Player: "+str$(pscore)
text 0,40,"Computer: "+str$(cscore)
if bz# > 260
inc pscore
xmo#=0
ymo#=0
zmo# = -2
bz# = 200
bx# = 0
by# = 0
endif
if bz# < -45
inc cscore
xmo#=0
ymo#=0
zmo# = 2
bz# = 200
bx# = 0
by# = 0
endif
sync
loop
Short code:
set window on : set window position 150,80 : set camera fov 3.14/5 : set display mode 600,600,32 : set camera view 0,0,600,600 : autocam off : move camera -200 : enable tnl : sync on : sync rate 30 : hide mouse : print "1 : Unbeatable" : print "2 : Unbeaten" : print "3 : Super hard" : print "4 : Very hard" : print "5 : Hard" : print "6 : Less hard" : print "7 : Medium" : print "8 : Easy" : print "9 : Easier" : print "10: Very easy" : print "11: Extra easy" : print "12: Super easy" : print "13: Too easy" : print "14: Unloseable"
print "15: Slower than a sloth" : input "Enter difficulty level(Decimals allowed): ",spd# : if spd# < 1 : spd# = 1 : endif : make object box 1,100,100,500 : color object 1,rgb(255,0,0) : make object box 2,20,20,5 : color object 2,rgb(0,150,0) : make object box 3,20,20,5 : color object 3,rgb(0,0,255) : fade object 3,500 : ghost object on 3 : make object sphere 4,5 : color object 4,rgb(255,255,0) : set object 4,1,1,1,1,0 : set object 2,1,1,1,1,0 : set object 1,1,1,0,1,1,1,1 : dim hx#(2) : dim hy#(2) : zmo# = -2 : bz# = 200 : do : mmox3#=mmox2# : mmox2#=mmox1#
mmox1#=mousemovex() : mmoy3#=mmoy2# : mmoy2#=mmoy1# : mmoy1#=mousemovey() : tx#=((mmox1#+mmox2#+mmox3#)/3) : ty#=((mmoy1#+mmoy2#+mmoy3#)/3) : hx#(1) = (mousex()/6)-50 : hy#(1) = 50-(mousey()/6) : position object 4,bx#,by#,bz# : position object 3,hx#(1),hy#(1),-45 : position object 2,hx#(2),hy#(2),240 : inc bx#,xmo# : inc by#,ymo# : inc bz#,zmo# : if bz# < -42 and bz# > -46 : distx# = bx#-hx#(1) : disty# = by#-hy#(1) : if abs(distx#) < 12.5 and abs(disty#) < 12.5 : if abs(distx#) > 10 : if distx# > 0 : inc xmo#,(distx#-10) : else : inc xmo#,(distx#+10) : endif : endif
if abs(disty#) > 10 : if disty# > 0 : inc ymo#,(disty#-10) : else : inc ymo#,(disty#+10) : endif : endif : zmo# = (0-zmo#) : inc bz#,zmo# : inc xmo#,tx#/3 : dec ymo#,ty#/3 : endif : endif : if bz# > 235 and bz# < 245 : distx# = bx#-hx#(2) : disty# = by#-hy#(2) : if abs(distx#) < 12.5 and abs(disty#) < 12.5 : if abs(distx#) > 10 : if distx# > 0 : inc xmo#,(distx#-10) : else : inc xmo#,(distx#+10) : endif : endif : if abs(disty#) > 10
if disty# > 0 : inc ymo#,(disty#-10) : else : inc ymo#,(disty#+10) : endif : endif : zmo# = (0-zmo#) : inc bz#,zmo# : inc xmo#,(hx#(2)-oldx#)/3 : dec ymo#,(hy#(2)-oldy#)/3 : endif : endif : if bx# < -47.5 : xmo# = abs(xmo#) : endif : if by# < -47.5 : ymo# = abs(ymo#) : endif : if bx# > 47.5 : xmo# = 0-abs(xmo#) : endif : if by# > 47.5 : ymo# = 0-abs(ymo#) : endif : oldx# = hx#(2)
oldy# = hy#(2) : hx#(2) = curvevalue(bx#,hx#(2),spd#) : hy#(2) = curvevalue(by#,hy#(2),spd#) : ink rgb(255,255,255),0 : line 0,0,197,197 : line 197,197,197,402 : line 0,599,197,402 : line 197,402,402,402 : line 197,197,402,197 : line 402,197,599,0 : line 402,197,402,402 : line 402,402,599,599 : ink rgb(255,0,255),0 : t# = (((bz#+45)*197)/285) : line t#,t#,600-t#,t# : line 600-t#,t#,600-t#,600-t# : line t#,t#,t#,600-t# : line t#,600-t#,600-t#,600-t# : tx = object screen x(4) : ty = object screen y(4) : ink rgb(0,255,255),0 : line tx,t#,tx,600-t# : line t#,ty,600-t#,ty : ink rgb(0,255,0),0 : text 0,0,"Fps: "+str$(screen fps())
text 0,20,"Player: "+str$(pscore) : text 0,40,"Computer: "+str$(cscore) : if bz# > 260 : inc pscore : xmo#=0 : ymo#=0 : zmo# = -2 : bz# = 200 : bx# = 0 : by# = 0 : endif : if bz# < -45 : inc cscore : xmo#=0 : ymo#=0 : zmo# = 2 : bz# = 200 : bx# = 0 : by# = 0 : endif : sync : loop
Executable is attached.
There are three types of people, those that can count and those that can't.