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 / Help with Pushing Objects (Benji's Function)

Author
Message
dab
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 11th Jul 2006 09:25 Edited at: 12th Jul 2006 03:05
OK, I want two (2) objects to push the same object. So, I copied Benji's code, and pasted the function with and copied the variables with 3's all over the place. Well, the first object that pushes still works, but the second doesn't work that well. The ball kinda slides off the object. I've searched all over my code for variables that might be used in the first function, but I can't figure it out. So here's my code (Not very commented):
(attached exe w/media)


What happens is when the box using arrows, WASD( F) pushes the ball left, the ball slides up.

I would really appreciate the help from you guys. Thanks Everyone,
have a nice day!

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 11th Jul 2006 11:36
It seems to work fine(you just need to add collision between the two cubes) when you jet rid of all the LOAD OBJECTs and LOAD IMAGES!

There are three types of people, those that can count and those that can't.
dab
19
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 11th Jul 2006 23:26 Edited at: 12th Jul 2006 03:15
Yah, it has media. I just forgot to upload it.

Anyway, when you control the WASDF box, and try going left with the ball, the ball slides up and away. It doesn't do that with the arrow key box. So, that must mean that something isn't working code wise.
Edit: If you go down on it, the ball goes through it. Hmm. I wonder if I can pinpoint to a certain point in the function...

Edit: Figured it out. Hehe, I had a:

if object collision (pushobj,obj)=1
bx#=newxvalue(bx#,object angle y(pushobj),speed#)
bz#=newzvalue(bz#,a#,speed#)
position object obj,bx#,by#,bz#
yrotate object obj,ba#
position object pushobj,bx#,by#,bz#
bla3=1
endif

I should of had an a3#.

Benji
18
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 12th Jul 2006 06:51
Oops, sorry I missed this and didn't post.

Sometimes you just have to name a variable 'bla'. Nothing else works.

Visit my Airplane Engine thread in the WIP board.

Login to post a reply

Server time is: 2024-05-22 21:35:32
Your offset time is: 2024-05-22 21:35:32