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.

Dark GDK / No Collision???

Author
Message
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 7th Jul 2012 20:00 Edited at: 7th Jul 2012 20:01
Hi all, i m using Sparky's Collision library but i m not getting any kind of collision can any one tell me why???
here is sample...
in Load Player Function

Load map function

here is main

can anyone tell me where i m wrong...???
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 7th Jul 2012 20:38
You haven't actually *checked* for collision. You need to check by using SC_ObjectCollision() or using RayCasting. Personally, I would add gravity and make the player "fall" until the player's object and the world object collide and then stop decreasing the Y value of the player. Unfortunately this would have problems with walls. For that, use SC_SphereSlide() from the player's old position to his new one and then use the SC_GetStaticCollision functions to slide the player along the wall.

Hope it helps!


Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 7th Jul 2012 20:39
any example??? sorry i m noob...
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 7th Jul 2012 21:11
Like this:



I've noticed at the end of the main loop you are updating object 3 twice per frame - there is no need, update object 10 (the player) but not the level because the level isn't moving (it doesn't need to be updated if it doesnt move)

Note: there is a much better way of doing it with ray casts but you have to rewrite a lot of your code to implement that and I don't know how it works.


Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 7th Jul 2012 21:13
thank you!!!!!!!
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 7th Jul 2012 22:48
i will never get the collisions working ;( ;(.... nothing working for me even trying the sliding demo code by SC....
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 8th Jul 2012 03:37
Wait, you compile the *exact* code included with the library, and it doesn't work? Or are you copying and pasting the code into your current project?


Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 8th Jul 2012 08:45 Edited at: 8th Jul 2012 12:52
exact code is working but when i copy and paste into my code, modify it according to my objects then its not working....

EDIT: is there any way to Get basic built-in collisions??????
and i have other question i m using old version of GDK for the working of animation class...(dbPlayObject() and dbLoopObject()) etc....
is it possible to to get these to functions working with GDK 2010 Update???
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 8th Jul 2012 14:47
I have the same problem as you with animations, when I updated my files from the site, then no animations played. I had to copy my files from my computer over, and then it worked. If it's allowed, then I could send you my DarkGDK folder because I don't know why the update breaks animations!

Furthermore, try instead setting your objects up like this:



Instead of box collision, that is polygonal collision. Change "OBJECTID" to the ID of your player and level.


Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 8th Jul 2012 16:04
yeah plz send me the DarkGDK folder so that i can work with animations....

and can u plz check that the GDK Sample "world" working on ur side??? its giving me error while loading BSP...
please check...
Thanks
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 8th Jul 2012 16:57
the only thing i need is Collision Working.... this will make certain possibilities... if i got collisions in my game my bullet function will work properly... after that i will complete my game in 1 and a half week or less.... THIS WILL SAVE MY NEXT SEMESTER AND ITS FEE.... THIS IS MY FINAL YEAR PROJECT...
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 10th Jul 2012 21:50
Ok thanks all, i got collision working with the help of my teacher... but my object is moving very fast... i m using thsi line to move....

can someone help me to understand this line...
how can i reduce movement speed using this??
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 11th Jul 2012 11:34
Divide it by a number larger than 1.

Login to post a reply

Server time is: 2024-04-18 02:03:32
Your offset time is: 2024-04-18 02:03:32