Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Uuh... It's a game with ball physics, moving platforms, and stuff. (dbc)

Author
Message
AnalSauceMonkey
21
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 28th Mar 2003 02:29 Edited at: 28th Mar 2003 02:40
This only works (correctly) with dbclassic. Collect the spinning boxes to win. Hold down the spacebar to keep bouncing and get higher. Yeah. (It might not look like 20 lines, but it will be when you paste it.)

hide mouse:sync on:sync rate 85:autocam off:make object sphere 1,4
color object 1,rgb(200,200,0):make object collision box 1,-2,-2,-2,2,2,2,0:position object 1,20,-90,0:ob=1:ob2=500
ob3=1000:for y=1 to 10:for x=1 to 30:read a:if a=1
ob=ob+1:make object cube ob,10:position object ob,x*10,y*-10,0:make object collision box ob,-5,-5,-5,5,5,5,0:color object ob,rgb(0,0,200)
endif:if a=2:ob2=ob2+1:make object cube ob2,10:position object ob2,x*10,y*-10,0
make object collision box ob2,-5,-5,-5,5,5,5,0:yrotate object ob2,90:color object ob2,rgb(0,200,0):endif:if a=3
ob3=ob3+1:make object cube ob3,6:position object ob3,x*10,y*-10,0:color object ob3,rgb(200,0,0):endif
next y:next x:color backdrop 0:do:for z=1001 to ob3
rotate object z,wrapvalue(object angle x(z)+5),wrapvalue(object angle y(z)+5),0:next z:if spacekey() and get object collision y()<0:grav#=(grav#+1.1)*.7:endif
xx#=(xx#+rightkey()*.1-leftkey()*.1)/1.1:x#=object position x(1):y#=object position y(1):x#=x#+xx#:grav#=grav#-.08
y#=y#+grav#:position object 1,x#,y#,0:for z=501 to ob2:ox#=object position x(z):move object z,.3
if object collision(1,z)=1:x#=x#+(object position x(z)-ox#):endif:if object collision(z,0)>1
yrotate object z,wrapvalue(object angle y(z)+180):endif:next z:if object collision(1,0)>0:if object collision(1,0)>=1000 and object collision(1,0)<=ob3 and object visible(object collision(1,0))
got=got+1:hide object object collision(1,0):endif:dec x#,get object collision x():dec y#,get object collision y()
if get object collision x():xx#=xx#*-.8:endif:if get object collision y()<>0:grav#=grav#*-.8
endif:endif:if got=ob3-1000:center text 320,200,"You Win!":endif
position object 1,x#,y#,0:position camera curvevalue(x#,camera position x(),5),curvevalue(y#,camera position y(),5),-60:sync:loop:data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,0,1,3,1,1:data 1,0,3,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1:data 1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,0,1,2,0,0,0,0,1
data 1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,1:data 1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1:data 1,0,0,0,0,1,2,0,0,0,0,1,1,1,1,1,2,0,0,0,0,0,1,1,1,1,1,0,1,1
data 1,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,3,1,0,0,0,1,1:data 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1:data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

AnalSauceMonkey
21
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 28th Mar 2003 03:01
WAIT!!!
New version (more friction and a slightly changed level):

hide mouse:sync on:sync rate 85:autocam off:make object sphere 1,4
color object 1,rgb(200,200,0):make object collision box 1,-2,-2,-2,2,2,2,0:position object 1,20,-90,0:ob=1:ob2=500
ob3=1000:for y=1 to 10:for x=1 to 30:read a:if a=1
ob=ob+1:make object cube ob,10:position object ob,x*10,y*-10,0:make object collision box ob,-5,-5,-5,5,5,5,0:color object ob,rgb(0,0,200)
endif:if a=2:ob2=ob2+1:make object cube ob2,10:position object ob2,x*10,y*-10,0
make object collision box ob2,-5,-5,-5,5,5,5,0:yrotate object ob2,90:color object ob2,rgb(0,200,0):endif:if a=3
ob3=ob3+1:make object cube ob3,6:position object ob3,x*10,y*-10,0:color object ob3,rgb(200,0,0):endif
next y:next x:color backdrop 0:do:for z=1001 to ob3
rotate object z,wrapvalue(object angle x(z)+5),wrapvalue(object angle y(z)+5),0:next z:if spacekey() and get object collision y()<0:grav#=(grav#+1.1)*.7:endif
xx#=(xx#+rightkey()*.15-leftkey()*.15)/1.2:x#=object position x(1):y#=object position y(1):x#=x#+xx#:grav#=grav#-.08
y#=y#+grav#:position object 1,x#,y#,0:for z=501 to ob2:ox#=object position x(z):move object z,.3
if object collision(1,z)=1:x#=x#+(object position x(z)-ox#):endif:if object collision(z,0)>1
yrotate object z,wrapvalue(object angle y(z)+180):endif:next z:if object collision(1,0)>0:if object collision(1,0)>=1000 and object collision(1,0)<=ob3 and object visible(object collision(1,0))
got=got+1:hide object object collision(1,0):endif:dec x#,get object collision x():dec y#,get object collision y()
if get object collision x():xx#=xx#*-.8:endif:if get object collision y()<>0:grav#=grav#*-.8
endif:endif:if got=ob3-1000:center text 320,200,"You Win!":endif
position object 1,x#,y#,0:position camera curvevalue(x#,camera position x(),5),curvevalue(y#,camera position y(),5),-60:sync:loop:data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,1,3,0,0,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,3,0,0,1,3,1,1:data 1,0,3,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1:data 1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,0,1,2,0,0,0,0,1
data 1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,0,3,0,0,0,1,1,0,0,0,0,0,1:data 1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1:data 1,0,3,0,0,1,2,0,0,0,0,1,1,1,1,1,2,0,0,0,0,0,1,1,1,1,1,0,1,1
data 1,0,0,0,1,1,0,0,0,0,0,1,1,3,1,1,0,0,0,0,0,0,1,3,1,0,0,0,1,1:data 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1:data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 28th Mar 2003 21:17
I'm sure that you'll be the next winner
very good, it's the best 20 lines prog that I have ever seen

Bu$herie
How many civilians is he going to kill ? I know that Bush will sit at God's left, next to Saddam.
AnalSauceMonkey
21
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 28th Mar 2003 23:13
I fixed something that I didn't notice got messed up somehow. The ball was supposed to bounce off the walls when you hit them. It works now.

hide mouse:sync on:sync rate 85:autocam off:make object sphere 1,4
color object 1,rgb(200,200,0):make object collision box 1,-2,-2,-2,2,2,2,0:position object 1,20,-90,0:ob=1:ob2=500
ob3=1000:for y=1 to 10:for x=1 to 30:read a:if a=1
ob=ob+1:make object cube ob,10:position object ob,x*10,y*-10,0:make object collision box ob,-5,-5,-5,5,5,5,0:color object ob,rgb(0,0,200)
endif:if a=2:ob2=ob2+1:make object cube ob2,10:position object ob2,x*10,y*-10,0
make object collision box ob2,-5,-5,-5,5,5,5,0:yrotate object ob2,90:color object ob2,rgb(0,200,0):endif:if a=3
ob3=ob3+1:make object cube ob3,6:position object ob3,x*10,y*-10,0:color object ob3,rgb(200,0,0):endif
next y:next x:color backdrop 0:do:for z=1001 to ob3
rotate object z,wrapvalue(object angle x(z)+5),wrapvalue(object angle y(z)+5),0:next z:if spacekey() and get object collision y()<0:grav#=(grav#+1.1)*.7:endif
xx#=(xx#+rightkey()*.1-leftkey()*.1)/1.13:x#=object position x(1):y#=object position y(1):x#=x#+xx#:grav#=grav#-.08
y#=y#+grav#:position object 1,x#,y#,0:for z=501 to ob2:ox#=object position x(z):move object z,.3
if object collision(1,z)=1:x#=x#+(object position x(z)-ox#):endif:if object collision(z,0)>1
yrotate object z,wrapvalue(object angle y(z)+180):endif:next z:if object collision(1,0)>0:if object collision(1,0)>=1000 and object collision(1,0)<=ob3 and object visible(object collision(1,0))
got=got+1:hide object object collision(1,0):endif:dec x#,get object collision x():dec y#,get object collision y()
if get object collision x()<>0:xx#=xx#*-.8:endif:if get object collision y()<>0:grav#=grav#*-.8
endif:endif:if got=ob3-1000:center text 320,200,"You Win!":endif
position object 1,x#,y#,0:position camera curvevalue(x#,camera position x(),5),curvevalue(y#,camera position y(),5),-60:sync:loop:data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,1,3,0,0,0,0,0,0,0,0,0,1,3,0,0,0,0,0,0,3,0,0,1,3,1,1:data 1,0,3,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1:data 1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,0,1,2,0,0,0,0,1
data 1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,0,0,3,0,0,0,1,1,0,0,0,0,0,1:data 1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1:data 1,0,3,0,0,1,2,0,0,0,0,1,1,1,1,1,2,0,0,0,0,0,1,1,1,1,1,0,1,1
data 1,0,0,0,1,1,0,0,0,0,0,1,1,3,1,1,0,0,0,0,0,0,1,3,1,0,0,0,1,1:data 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1:data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 28th Mar 2003 23:14
Wow, that's really quite good. Especially the level design, how you have to gain height to bounce it to some areas. Very good!

Once I was but the learner,
now, I am the Master.
AnalSauceMonkey
21
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 28th Mar 2003 23:32
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 28th Mar 2003 23:55
That's excellent. I have a suggestion though, when you have a large snippet for the forum use the code button to put it in a code box, makes it look a lot better



Whatever I did I didn't do it!
D Man
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 29th Mar 2003 00:14
It works for DBPro too if you separate the sync.
Like this.



btw. It's the best game i've ever seen in 20 lines .

"If you can't make it good
make it look good."
Bill Gates
AnalSauceMonkey
21
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 29th Mar 2003 00:16 Edited at: 29th Mar 2003 00:17
Kentaree, I tried that at first, but it took out some things so I didn't use it. It seemed to work for you though.

AnalSauceMonkey
21
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 29th Mar 2003 00:21
D Man, yeah it almost works like that, but it's a little buggy. I couldn't figure out why the collision wouldn't work right in dbpro; the ball looked like it was always jumping.

D Man
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 29th Mar 2003 11:31
That's why it was so fuckin' hard .

"If you can't make it good
make it look good."
Bill Gates
Chaos
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 29th Mar 2003 15:24
i have dbc but when i run it it just says unrecognised parameter.

Darkworlds are all around us just open your eyes
Most of us are still half asleep
pugmartin
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 2nd Apr 2003 03:16
Superb mate. really good work. good fun too. could make quite a few fun levels with a lev editor...

That picture actually is me you know...
Can anyone post me a banana?
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd Apr 2003 06:25
u got that engine lookin good analsaucemonkey^_^

[center]These are called variables and each one has a little label on it carved in cuneiform script by the hand of an ancient Babylonian black box engineer.
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd Apr 2003 06:30
pugmartin lol, i saw this idea in the forums a while back by anal, so i went and recreated the engine to suit what i wanted it to do with his permission, and in fact, created a level editor, plus the ability to add multiple levels..and in fact..i had a demo of it...which is no longer up i should find it again...i should continue work on it, it was one of my favorite projects to date, only cuz it was soooo cool to build the levels, then to play them^_^ analsaucemonkey you really came up with a diehard game there, infinate replayability in this engine

[center]These are called variables and each one has a little label on it carved in cuneiform script by the hand of an ancient Babylonian black box engineer.
pugmartin
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 2nd Apr 2003 20:10
Damn right. I can remember making little diversions like this on the amiga, but having to use about 20 lines on the bounce code alone...

Ah, things were so simple back then...

That picture actually is me you know...
Can anyone post me a banana?

Login to post a reply

Server time is: 2024-04-18 17:05:29
Your offset time is: 2024-04-18 17:05:29