I've made the simplest game ever so I thought you guys might like it
You control a circle that moves across the screen, each time you left-click you gain a point and the boundary moves to your click position. You can switch between horizontal and vertical movement/boundaries by right-clicking.
You must always click inside the boundaries or you will lose.
I managed 26 clicks, who can beat that?
[edit]
I got 35 clicks!!
[NEW VERSION 14/1/08 2:40]
`Vanishing Point
`By OBese87
gosub setup
gosub menu
gosub reset
DO
gosub move
gosub click
gosub display
LOOP
END
`----------------
` GOSUBS
`----------------
menu:
hi=0
newR=returnkey()
do
`get returnkey status
oldR=newR
newR=returnkey()
`get menu selection input
oldin=u+d
u=upkey():d=downkey()
if u+d>oldin
inc hi,d-u
if hi<0 then hi=2
if hi>2 then hi=0
endif
`action
if newR>oldR
If hi=2 then end : `quit
If hi=1 then gosub help
If hi=0 then exit
endif
`display
center text 512,52,"________________"
center text 512,50,"VANISHING POINT"
for opt = 0 to 2
if hi=opt then option$="["+menu$(opt)+"]" else option$=menu$(opt)
center text 512,360+opt*20,option$
next opt
sync:cls
loop
return
`----
help:
cls
center text 512,52,"_____"
center text 512,50,"HELP"
center text 512,120,"There is a circle moving from side to side; You can switch between horizontal and vertical movement by right-clicking the mouse."
center text 512,140,"To score points you must left-click the mouse when the circle is inside all four red boundaries; this will also shrink the boundaries relative to your current axis of movement"
center text 512,160,"i.e. clicking while in horizontal movement will only adjust the left and right boundaries."
center text 512,180,"The boundaries will be re-positioned to where the circle was on that axis when you clicked the mouse."
center text 512,220,"PRESS ANY KEY TO RETURN TO THE MAIN MENU"
wait 10:sync
`wait for single key press
newkey=scancode()
repeat
oldkey=newkey
newkey=scancode()
until newkey>oldkey
return
`----
setup:
set display mode 1024,768,32
hide mouse
sync on
sync rate 60
ink 65536*255,0
set text opaque
DIM menu$(2)
menu$(0)="PLAY"
menu$(1)="HELP"
menu$(2)="QUIT"
return
`----
reset:
score=0
Xbound=0
Ybound=0
X=512 : Y=384
Move=0
Speed=10
return
`----
move:
`adjust position
inc X, (move=0)*speed - (move=1)*speed
inc Y, (move=2)*speed - (move=3)*speed
`when circle hits side change direction
if X<0 or X>1024 and move<2 then move=1-move
if Y<0 or Y>768 and move>=2 then move=3-(move-2)
return
`----
click:
`on click
oldmc=mc : mc=mouseclick()
if mc>oldmc
if mc=1
`check for game over
if X<Xbound or X>1024-Xbound or Y<Ybound or Y>768-Ybound
print "You lose! You scored ";score;" clicks!"
wait key
gosub menu
gosub reset
else
`adjust boundaries
if move<2
if X<512 then Xbound=X else Xbound=1024-X
else
if Y<384 then Ybound=Y else Ybound=768-Y
endif
`increase score
inc score,1
endif
else
`switch hor/ver
if move<=1 then move=2 else move=0
endif
endif
return
`----
display:
`boundaries
line Xbound,0,Xbound,768
line 1024-Xbound,0,1024-Xbound,768
line 0,Ybound,1024,Ybound
line 0,768-Ybound,1024,768-Ybound
`marker
circle x,y,3
`score
print "Clicks: ";score
sync:cls
return
even though this is a very simple game it was quite pleasing to actually finish something for once. I came up with the concept, planned it out and wrote the code (and thought of a cool name
) all in about half an hour!