GRID-LOCK
By RUCCUS
I got bored and started working with my move-object-with-mouse formula I made, I wanted to make an example so I could show people what the forumla could do. Anyways, after a while I got hooked on making the game. It was pretty fun and I decided to make it into a 20 liner entry, that decision right there took me from doing a small game in 1 hour to a stress full game in 3 hours, jeez compacting code into 20 lines is hard. Anyways I finally finished and here it is, here's the info and specs of the game:
Game Specs'
-Made in DBP
-Exactly 20 lines (excluding comments)
-No media required
Game info
-You're a cool looking ball...thing. You move your mouse around to control the ball. Try and dodge the cubes coming at you as long as possible. I added in a quick high score storage system so you'll be able to see your best score, but it doesnt save them when you exit.
- I tried to incorperate as much randomness as possible in it. The box locations, sizes and speeds are all random. As you progress through the game the boxes go faster and faster, thus the game has a difficulty level in it.
- Just to add some more coolness I made the ball look cool with a ghosted sphere around it,
Game Controls
Move Mouse to move ball
If you die press any key (except esc.) to restart
If you want to exit press esc.
Other Notes
It's my first Entry to the 20 liner so c/c is highly encouraged, I want to know people think! Well, without further adue...adew...adoo..umm, without further waiting, here it is:
V2 - Bug Fixes: Cant go out of screen and get mad scores
`GRID-LOCK
`Created by RUCCUS:04/17/05
SYNC ON:SYNC RATE 100:POSITION MOUSE 319.5,237:HIDE MOUSE:SPEED#=7: COLOR BACKDROP BLACK
MAKE OBJECT SPHERE 100,25,25,25:MAKE OBJECT SPHERE 110,40,40,40:GHOST OBJECT ON 110
FOR i=200 to 210 STEP 1:MAKE OBJECT CUBE i,20+rnd(60):GHOST OBJECT ON i:POSITION OBJECT i,-600+rnd(1200),0,260:NEXT i
POSITION CAMERA 0,200,-600:POINT CAMERA 0,0,0
POSITION:
FOR i=200 to 210 STEP 1:POSITION OBJECT i,-600+rnd(1200),0,260:NEXT i
DO
RNDX#=-400+RND(700):SCORE#=SCORE#+1:SPEED#=SPEED#+.001:CENTER TEXT 310,50,"GRID-LOCK":CENTER TEXT 310,65,str$(HISCORE#):CENTER TEXT 310,80,str$(SCORE#):CENTER TEXT 310,400,"Created by RUCCUS of RUCCUS.net and TGC for the 20-Line Challenge":IF SCORE#>HISCORE# THEN HISCORE#=SCORE#
FOR i=200 to 205 STEP 1:MOVE OBJECT i,0-rnd(SPEED#):NEXT i
FOR i=205 to 210 STEP 1:MOVE OBJECT i,0-rnd(SPEED#):NEXT i
FOR i=200 to 210 STEP 1
IF OBJECT IN SCREEN(i)=0 THEN SCALE OBJECT i,75+RND(60),75+RND(60),75+RND(60):POSITION OBJECT i,RNDX#,0,200
NEXT i
POSITION OBJECT 110,OBJECT POSITION X(100),OBJECT POSITION Y(100),OBJECT POSITION Z(100)
IF MOUSEY()<237 THEN POSITION OBJECT 100,MOUSEX()-(SCREEN WIDTH()/2),0,ABS(MOUSEY()-(SCREEN HEIGHT()/2))
IF MOUSEY()>237 THEN POSITION OBJECT 100,MOUSEX()-(SCREEN WIDTH()/2),0,-(MOUSEY()-(SCREEN HEIGHT()/2))
FOR i=200 to 210 STEP 1:IF OBJECT COLLISION (100,i)=1 THEN WAIT KEY:SCORE#=0:SPEED#=7:POSITION MOUSE 319.5,400:GOSUB POSITION
NEXT i
SYNC
LOOP
`A simple game I made when I was bored, took me about 3 hours to
`finish what I thought would be a simple project. The hard part
`was getting it in 20 lines so I could submit it for the 20LC.
`CONTROLS
`Use the mouse to move your ball around, dodge the boxes flying
`towards you for as long as you can!
`Feel free to edit the code if you want. Try changing the camera
`View to be right behind the ball, it's INSANE.
`Also, I included my formula for moving objects with the mouse
`in here to help people understand what I meant in the tutorials
`a bit more.
`- Goodluck, RUCCUS.