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.

Newcomers DBPro Corner / Just wondering a few things about collision.

Author
Message
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 3rd Nov 2004 16:55 Edited at: 3rd Nov 2004 17:53
I have a small amount of my code for my platforming game finished, but some things about collision puzzle me. I have my object return jumped=0 when it hits the original static collision box I made which allows the character to jump again. I was wondering how I could make jumped=0 when its colliding with any 'ground' object, such as stairs or a platform.

Here's the code:



Also, the object sits perfectly on the static collision box, but when it sits on top of the second object I've created which only has a regular collision box, it slowly sinks through it. I've sort of alleviated this problem a bit, but the object seems fidgidy on when it rests on top of it.

I really just wondered why the moving objects collision box continues to move past the stationary collision box at all. When moving along the X axis and there is a collision, they overlap some, and the first object slowly slides backwards until they do not overlap. When the key is held to move them into the box it slowly moves through it *scratches head*...

Is there any way, using the general basis of sliding collision I have at the moment, that I could prevent this problem?

Thanks

Neeeeeeeewom!
Hop a long
20
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 6th Nov 2004 06:53
Hi Hat
I think your snippet is the code you finished your jump question thread with. So instead of answering your last post in the previous thread I'll put the answer here. There were some conflicts
in the collision detection. Also, you are using DBPro while I write in DBC. I don't have a Global assignment. To keep things simple I put all the code in one function.



Try this and see how it works.
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 7th Nov 2004 04:22
Thanks, it does work better. I just broke down and got Nuclear Glory's Collision .dll though, so my codes drastically changed. I shoulda seen your reply sooner =P

Neeeeeeeewom!
Hop a long
20
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 7th Nov 2004 12:55
Cool! Good Luck with the dll. I enjoyed working with your platform idea. It made me rethink some of my coding. I put together a short example based on some of the things I saw you were trying to do. Check it out:
http://www.geocities.com/hifin2003/platform_jumping.html
If you think it's OK let me know and I'll put in a line about getting the idea from you.
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 7th Nov 2004 14:38 Edited at: 7th Nov 2004 14:40
The .dll is working wonderfully after some mild kinks. I now have a near perfect version of the platforming code I'm going to build my game around.

Your example certainly would have been a nice bit of code to have had in the beginning without having to fiddle with ideas for so long, though it is nice to figure things out on your own around the basic moulding of others ideas. Makes for more thorough learning! It'd be cool if you mentioned where you got the idea, though I'm quite the novice!

I tried copying and pasting the code and it had some weird behavior, I couldn't quite tell where the cube was sitting and it seemed that only the camera jumped, not the cube . Is that because its designed for DBC? I'm guessing so.. so I can't really see how it should work... still a good idea with some nice controls!

Neeeeeeeewom!
Hop a long
20
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 8th Nov 2004 08:45 Edited at: 8th Nov 2004 09:18
I'm glad to hear you are well on your way now. Thanks for taking the time to view my code. Sorry it didn't work in DBPro. Since I wouldn't have written it with out seeing your thread and it's OK with you, I'll mention you on the page.

Be Well
sadsack
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 9th Nov 2004 09:05
nice hop a long renny
Hop a long
20
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 9th Nov 2004 11:11 Edited at: 9th Nov 2004 11:16
Hi Sad
Thanks, I think...??? renny ???
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 9th Nov 2004 19:54 Edited at: 11th Nov 2004 15:54
Hey, I was trying to get the y position of whatever object my object collides with, but something is awry with the CollisionHitObj command and how I'm using it.



when I use this in my collision function the program fails to run. When I remove the z=CollisionHitObj(1,1) line it works fine... that is it actually brings up the error that Object Position Y(z) doesn't make sense rather than just nothing.

Is there something wrong with my usage of it, and is there any way that I could simply get the y position of whatever object I collide with since the "object position y(z)" doesn't seem to be working since it needs an integer...

Thanks!



I figured it out, but as usual trudging forward has created more problems. My object just continues to move into the object it collides with slightly, which causes it to be unable to move until it slowly slides back out. Its not a huge problem but something I'd like to work out early. Meh

Neeeeeeeewom!

Login to post a reply

Server time is: 2024-11-27 15:41:52
Your offset time is: 2024-11-27 15:41:52