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 / Collision detection not working.

Author
Message
Triangle Trumper
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location: Private
Posted: 4th Apr 2008 23:43 Edited at: 5th Apr 2008 06:50
I'm creating a small 'battle arena' type game, and it's still very incomplete. The only problem so far is that the collision detection won't work. If you're wondering, yes, I read the tutorial again and again, it still doesn't work. Here's the code:


Please post an extension of the code explaining what I've done wrong.

If con is the oppostie of pro, then what is the opposite of progress?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Apr 2008 23:55
Quote: "the collision detection won't work"


Specifics please. 'Won't work' isn't a lot of help.

Quote: "I read the tutorial again and again"


Which one?

Your code looks like it should work - it's what you are doing when the collision triggers that doesn't look right. You are also only checking for collision between objects 4 and 1 though.

Read a proper tutorial on collision...

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

(Tutorial number 10).

TDK_Man

Triangle Trumper
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location: Private
Posted: 5th Apr 2008 00:19
@TDK: Won't work? Pretty much all the sphere does is move straight through the brick wall. Tutorial? I was using the Monster Hunt tutorial on the site. I read your tutorial, and tried the different commands. For OBJECT HIT() it finds the collision fine, the sphere stops for a second, but then continues to go through the brick. For OBJECT COLLISION() it found the collision, then stopped the sphere for all eternity. Hope that answers your questions.

If con is the oppostie of pro, then what is the opposite of progress?
Triangle Trumper
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location: Private
Posted: 5th Apr 2008 23:45
Nevermind, fixed the problem.

If con is the oppostie of pro, then what is the opposite of progress?
jeffhuys
18
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 7th Apr 2008 19:18 Edited at: 7th Apr 2008 19:18
Also, use relative paths. Do not use
Quote: "load image "C:/Program Files/Dark Basic Software/Dark Basic/media/bitmaps/textures/realmetaldull01.bmp",3"

But use (if your project is in C:/Program Files/Dark Basic Software/Dark Basic/)
Quote: "load image "media/bitmaps/textures/realmetaldull01.bmp",3"

This will allow other people to play the game properly.

Jeff.


You're the 'th to view this signature!

Login to post a reply

Server time is: 2024-09-27 12:16:22
Your offset time is: 2024-09-27 12:16:22