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 Discussion / Interesting predicament...

Author
Message
Yodaman Jer
User Banned
Posted: 2nd Jan 2009 23:04
Hey all!

It's been a while since I've done any form of programming. Lately I've been goofing off over in the Geek Culture threads and over there someone recently started a thread about making games in January and completing them. At first I didn't want to enter ( I think I missed the deadline anyway) but now I really am motivated to get this project of mine done. For now it's called Maze-O-Mania but I might change it later. Anyway, whilst making it and testing it out, I came across an interesting problem.

The object that the player object bumps into to go the next level is object #15 for now. I have it set up like this to work:



The thing is, when the player object (a sphere that will have a marble texture on it later) bumps into it, it goes right THROUGH it, even though it's programmed to go to WIN1, delete all of the objects and lights, and move on to level 2 (which hasn't even been constructed yet, but will be once I get this sorted out).

I have no idea what's causing this. It just goes through object 15. Does anyone have any ideas as to what is causing this?

"People still have 1024x768?" -Jeku
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Jan 2009 23:57
DBC collision can give you problems.

Make sure when you create your objects you do 2 things if you want collision:

1. Set Object Collision On <object num>
2. Set Object Collision To boxes,spheres or polygons or Make object collision box etc.

If you use Make object Collision Box, collision will only be detected with other objects that have used Make Object Collision Box or Make static object collision box.

If you Scale the object, after scaling:

1. Set Object Collision Off <obj>
2. Set Object Collision On <obj>
3. Set Object collision to whatever

Using Global Collision on and Off is unpredictable. It's better to set individual objects' collision status.

Enjoy your day.
Yodaman Jer
User Banned
Posted: 3rd Jan 2009 00:09 Edited at: 3rd Jan 2009 00:09
The thing is I've done this before, without making the "tele-porting" object use collision at all. For example:


And I thought I could change it around so that when the player bumps into this object, you win the first level and go to level 2. Maybe this isn't possible this way? But if that's the case how come I can get the game over screen to pop-up?

You know what, here's my source code, it might make things clearer:


"People still have 1024x768?" -Jeku
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Jan 2009 00:48
Did you try out any of the above suggestions? From looking at the code (though I just scanned it quickly) it seems that you are trying to detect collision with a static collision box. Only an object that has used Make Object Collision Box can have collision detected between it and a static collision box.

After:


try putting:


Here's your code with that addition. I also changed the sync rate to 60 because it was too fast at 0. I also removed references to media so I could run it.



Enjoy your day.
Yodaman Jer
User Banned
Posted: 3rd Jan 2009 02:46 Edited at: 3rd Jan 2009 02:48
Oh! Thanks Latch, I'm sorry, I misunderstood at first. I ran it and it ran great (and I discovered that it runs SO much faster when it's not textured...maybe I'll make the boxes one solid color rather than have a bunch of textures and mip-mapping commands) when only programmed to run at 60 FPS.

I completely misunderstood your original post, I thought you thought that I was having a separate issue with another form of collision. I now remember that my original tests (back about a year ago)did have the box collision command. Thanks man!

btw, what kinda computer you got if it runs too fast at 0? I usually set it to 0 to make it run fast because 60 is usually too slow, however after you removed the texturing and such it definitely ran a lot smoother.

"People still have 1024x768?" -Jeku
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Jan 2009 22:03
Quote: "btw, what kinda computer you got if it runs too fast at 0?"

Nothing special. It's about 7 years old - AMD 1.5 ghz processor . Radeon 9000 graphics card with 128mb . Though, I run DBC in windows 98 which means DBC pretty much runs in the environment it was designed to. At a sync rate of 0, your program runs at 190 FPS on my machine.

I removed the references to loaded media so I could run the program. It wasn't to try and capitalize on speed. With the textures and stuff included, it may have run more slowly at a 0 Sync rate.

Enjoy your day.
Yodaman Jer
User Banned
Posted: 9th Jan 2009 21:22
Quote: "At a sync rate of 0, your program runs at 190 FPS on my machine."



190 FPS?!?!??!!?! Holy cow!! That's insanely fast!

Login to post a reply

Server time is: 2026-07-05 01:47:43
Your offset time is: 2026-07-05 01:47:43