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 / What is wrong with these collisions?

Author
Message
BeastMaster
11
Years of Service
User Offline
Joined: 10th Apr 2015
Location:
Posted: 19th May 2015 21:32
I have this code in my main do/loop

where object 1 is my controllable character and object 405 is the object i want to crash into but my character just goes through it. What am i doing wrong?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th May 2015 12:49 Edited at: 20th May 2015 12:52
The following complete runnable snippet works perfectly for me. Perhaps you've done something wrong elsewhere in your code? Why have you put that code inside your main loop?



Edit Oops! I meant right key in the message of course.



Powered by Free Banners
BeastMaster
11
Years of Service
User Offline
Joined: 10th Apr 2015
Location:
Posted: 20th May 2015 17:38
I thought that the program must be checking for a collision in order for the collision to work? That's why I put the code in the main loop so it continuously checks for the collision.

I've simplified my program to the basics, removing all the textures and stuff so there would be less code and it would be easier to analyze. But I still cant figure out what I'm doing wrong.

This is my whole program

I'm trying to get my character to crash into the trees but it just goes through them.
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 20th May 2015 23:34
You must use the integer=Object Collision (objA,objB) command and give it an action if the return value is 1 ( 1 means collision is detected)

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st May 2015 00:39
Quote: "You must use the integer=Object Collision (objA,objB) command and give it an action if the return value is 1 ( 1 means collision is detected)"


Which was one of the points of my demo of course.



Powered by Free Banners
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 21st May 2015 01:33
Right, probably it needs to be explicited more for him to understand .
Let's how he reacts.
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 21st May 2015 01:34
Right, probably it needs to be explicited more for him to understand .
Let's see how he reacts.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st May 2015 01:36
Quote: "Right, probably it needs to be explicited more for him to understand .
Let's see how he reacts."






Powered by Free Banners

Login to post a reply

Server time is: 2026-07-05 20:45:46
Your offset time is: 2026-07-05 20:45:46