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.

DarkBASIC Professional Discussion / 20 Line Challenge why bother?

Author
Message
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 22nd Dec 2002 14:53
So I am trying to write a 20 line callenge!!!

I ran into more bugs than you can swipe a stick at!
I mean come on!
It's almost as if they want to give us a taste and yet keep it away from us!

I don't blame them because the only reason they made "oo" was to keep the foreigners and most of us from understanding it!!!
This is my firm belief!
However;
I give you two version of source code that do practically the same thing...

In each case the problem comes down to the "sync" command.

See if you are intelligent enough to figure out why the sync command is at fault! and also check to see if you can figure out why orientation commands work different for camera and objects!!!

Here is the code for both;
Don't forget to give me stinking credit ok?


----------------------------


Load object "ship1.x",1
sync on
make object sphere 13,1
move object 13,50
set object ambient 1,150
autocam off
make object sphere 14,1
hide object 14

do
if rightkey()=1 then turn camera right 0,0.5

if leftkey()=1 then turn camera left 0,0.5



set object to camera orientation 14
set object to object orientation 1,14


move object 14,20
move object down 14,5


ax=object position x(14)
ay=object position y(14)
az=object position z(14)
point object 1,ax,ay,az
move object 1,20
move object down 1,5

if controlkey()=1
for i=2 to 11
if object exist(i)=0 and knock=0 and timer()>aaa+100
make object sphere i,2
set object to object orientation 14,i
position object i,ax,ay,az
move object i,10
move object down i,5
color object i, rgb(255,0,0)
knock=1
endif
next i
endif

if knock=1
knock=0
aaa=timer()
endif


set cursor 0,0
z=object position z(2)
print "z";z

for i=2 to 11
if object exist(i)
move object i,1
if object position z(i)>200 then delete object i
endif
next i



sync



loop
rem this is the end of program 1
---------------------------------------------------

Load object "ship1.x",1
sync on
set ambient light 50




do
control camera using arrowkeys 0,1,1
set object to camera orientation 1
move object 1,20
move object down 1,5
sync
if controlkey()=1
for i=2 to 11
if object exist(i)=0 and knock=0 and timer()>aaa+100
make object sphere i,2

set object to object orientation i,1
color object i, rgb(255,0,0)
knock=1
endif
next i
endif

if knock=1
knock=0
aaa=timer()
endif


set cursor 0,0
z=object position z(2)
print "z";z
for i=2 to 11
if object exist(i)
move object i,1
if object position z(i)>200 then delete object i
endif
next i

loop
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 22nd Dec 2002 14:59
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 22nd Dec 2002 15:00
OOps; here yall go

http://www.boyar.net/ship1.x
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 22nd Dec 2002 15:01
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 22nd Dec 2002 15:04
http://www.boyar.net/ship1.zip
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 22nd Dec 2002 15:04
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 22nd Dec 2002 15:20
ICERGB

"See if you are intelligent enough to figure out why the sync command is at fault! and also check to see if you can figure out why orientation commands work different for camera and objects!!!"

You have a serious attitude problem. Sort it out. This is not a school, it is a forum. Yes the sync command has quite a few faults, but perhaps you are doing something wrong.

If you look in the 20-Line-challenge forum, you will see that many people have managed to cope despite DBP's bugs. We are not the ones who need to know these problems. Lee is, and I suggest if you want a result you drop the sarcastic tones.

Let's forget about this now - If you want to be able to get into DB and the community you have to approach it in the right way

NOBODY has a forum name as stupid as Darth Shader. I do.
Kangaroo2
21
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 22nd Dec 2002 17:47
I agree you sound too aggresive in some of your postings. The 20 line challenge is a fun way for good programmers to test their skill. Getting round bugs is a nice way to do this till everything works

* If the apocalypse comes, email me *
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 23rd Dec 2002 12:10
You are right,
I apologize

I was very frustrated...

It's hard to know if I am at fault it is the code; that is the frustrating part.

Maybe the post should be erased...

Just put the code back in?
Nikkoz
21
Years of Service
User Offline
Joined: 31st Aug 2002
Location: Sweden
Posted: 23rd Dec 2002 13:02
ICERGB:
Dont worry, when you grow up you'll learn to have a decent attitude to people that are supposed to help you. You cant be more that 12, right?
Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 25th Dec 2002 16:18
Lay down Nikkoz, he appologized already ok? Give him at least a chance. Let's just hope he has learned.

Yskonyn -
"It's better to wish down here you were up, then to wish up there you were down."
"The ONLY time you have too much fuel on board is when you are on fire."
ICERGB
21
Years of Service
User Offline
Joined: 8th Nov 2002
Location: Canada
Posted: 26th Dec 2002 15:18

I'm just sad

Login to post a reply

Server time is: 2024-05-04 23:21:12
Your offset time is: 2024-05-04 23:21:12