It's not like a game, more like a viewable simulation type... thing. Anyways, at the beginning of the program, the user types in the amount of circles that will be fighting each other. The circles are created and randomly placed and then they start flying. As they collide with one another, one circle disappears. They keep destroying each other until there is one circle left. The probability of a circle being destroyed decreases exponentially as the amount of circles decreases, and inversely, increases exponentially when there are a lot of circles. As a result, no matter how many circles the user decides to put in, there are usually only about 10 circles remaining after the first 1.5 seconds of the "game". This is when the fun begins. This is where you can actually start watching the circles destroy each other until it is down to the final 2. All the circles are numbered and have their number above them. When a circle collides with another circle, it's direction changes to make it look somewhat realistic. The highest numbered circle is colored red. It requires no media so I will just post it as a code snippet. Enjoy watching these circles destroy each other!
input "How many balls will fight each other? ",maxball
dim ballx(maxball)
dim bally(maxball)
dim ballxspeed(maxball)
dim ballyspeed(maxball)
mousesafe=0
for ballnum = 1 to maxball
ballx(ballnum) = rnd(640)
ballxspeed(ballnum) = 1
next ballnum
for ballnum = 1 to maxball
bally(ballnum) = rnd(480)
ballyspeed(ballnum) = 1
next ballnum
do
cls
for ballnum = 1 to maxball
if maxball = 1
ink rgb(0,255,0),0
center text 320,200,"There is one ball left."
center text 320,240,"It will now continue on"
center text 320,280,"For the rest of eternity"
center text 320,320,"Or until you interfere"
endif
if ballnum = maxball
ink rgb(255,0,0,),0
else
ink rgb(255,255,255),0
endif
circle ballx(ballnum),bally(ballnum),10
inc ballx(ballnum),ballxspeed(ballnum)
inc bally(ballnum),ballyspeed(ballnum)
center text ballx(ballnum), bally(ballnum) - 20, str$(ballnum)
if mouseclick()=1 then mousesafe = 1
if mouseclick() = 0 and mousesafe = 1
ballx(ballnum) = mousex()
bally(ballnum) = mousey()
mousesafe = 0
endif
`wall collision for the circles
if ballx(ballnum) > 640 then ballxspeed(ballnum) = ballxspeed(ballnum) *-1
if ballx(ballnum) < 0 then ballxspeed(ballnum) = ballxspeed(ballnum) *-1
if bally(ballnum) > 480 then ballyspeed(ballnum) = ballyspeed(ballnum) *-1
if bally(ballnum) < 0 then ballyspeed(ballnum) = ballyspeed(ballnum) *-1
for secondball = 1 to maxball `code for 'other ball' collisions
if ballnum <> secondball
if ballx(ballnum) > ballx(secondball) - 7 and ballx(ballnum) < ballx(secondball) + 7 and bally(ballnum) > bally(secondball) - 7 and bally(ballnum) < bally(secondball) + 7
ballxspeed(ballnum) = ballxspeed(ballnum) *-1
ballyspeed(ballnum) = ballyspeed(ballnum) *-1
ballxspeed(secondball) = ballxspeed(secondball) *-1
ballyspeed(secondball) = ballyspeed(secondball) *-1
dec maxball,1
endif
endif
next secondball
next ballnum
loop
One last thing I forgot. If you click anywhere on the screen, a circle will be instantly repositioned on the screen where your mouse is. This is useful when there are only 2 circles left and you are bored of watching them chase each other.
Don't take life too seriously... no one gets out alive.