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 / Here's the 20-line winner in easy form.

Author
Message
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 26th Jan 2003 16:29
I opened TheDartster's masterpiece to 'normal' programming form. So here it is on about 125 lines of code for learning purpose.


` 20-liner January 2003 winner
` Programmed by TheDarthster

dim x#(2)
dim z#(2)
dim oldx#(2)
dim oldy#(2)
dim oldz#(2)
dim cy#(2)
dim shot#(2)
dim fragged#(2)
dim score#(2)
create bitmap 1,2,2
cls rgb(255,255,255)
get image 1,0,0,1,1
set current bitmap 0
delete bitmap 1
for i=1 to 2
make object cylinder 100+i,50
scale object 100+i,100,300,100
x#(i)=(int(rnd(1))*1600)+100
z#(i)=(int(rnd(1))*1600)+100
make object sphere 102+i,10
position object 102+i,-1000,-1000,-1000
make camera i
next i

set camera view 1,0,0,640,240
set camera view 2,0,240,640,480
dim level(138)
data 2,2,4,2,7,2,8,2,2,3,4,3,5,3,4,4,7,4,9,4,2,5,4,5,6,5,7,5,9,5,1,6,2,6,4,7,5,7,7,7,8,7,2,8,3,8,8,8,6,9,0,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,10,0,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,1,10,2,10,3,10,4,10,5,10,6,10,7,10,8,10,9,10,3,4,6,8,8,3
for i=0 to 67
read level(i*2)
read level((i*2)+1)
if i 0
fragged#(i)=fragged#(i)-1
ink rgb(fragged#(i)*8.5,0,0),0
text 320,(i*240)-120,"Fragged!!"
if fragged#(i)=0:x#(i)=(int(rnd(1))*1600)+100
z#(i)=(int(rnd(1))*1600)+100
endif
endif
position camera i,x#(i),125,z#(i)
rotate camera i,0,cy#(i),0
position object 100+i,x#(i),75,z#(i)
ink rgb(255,255,255),0
text 20,(i*240)-220,"Frags:"+str$(score#(i))
if score#(i) >= 10
repeat
text 320,(i*240)-120,"Winner!"
until escapekey()=1
end
endif
next i
loop
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 26th Jan 2003 16:36
So here it is

Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 26th Jan 2003 16:37
Once more here's the code!

Revolution
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 26th Jan 2003 20:41
I was talking to TheDartster the other day and he said that he had made this in october when he had the demo of pro, he said he made it in a few hours. That seems very fast to me. Prob because i do other things as well.
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 2nd Feb 2003 14:27
That's very impressive, if a little dark!

Visit [url]www.lightning-systems.co.uk[/url]
You are the th person to view this signature.
adamsmasher23
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: United States
Posted: 9th Feb 2003 23:46
Should you have DBPro to use it? Because when I try to run it it says 'Compiler error-line exceeds 255 characters in length.'

Whatever I did it wasn't me!
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 10th Feb 2003 19:58
Yes, you need DBPro to run it. Because of the broken 255 character line limit, but mainly because it uses 2 cameras.

Yes, I did make it using only the trial version, I had to get to grips with DBPro before I made it, but managed it in about an hour or two, including time to figure out the new camera commands, and come up with a map format.

Once I was but the learner,
now, I am the Master.

Login to post a reply

Server time is: 2024-04-20 12:00:00
Your offset time is: 2024-04-20 12:00:00