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.

2D All the way! / How do I do sprite collision for DBC... Tutorials not working.

Author
Message
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 27th Sep 2003 03:46
I have yet to figure out how to do sprite collision in DBC. Is it extremely hard. Is it possible for someone to give me some sprite collision code and explain it as much as possible. If you can give me an example can you include in your example, two bitmaps/.bmp

Just the minimal example, maybe just having the 2, when you move one into the other a message pops up. Nothing too complex for me.

Thanks
Nicolas

Future Company Name = Blazing Fire
Current Website Name = Blazing Fire
Future Number is Eleventy
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 27th Sep 2003 12:23 Edited at: 27th Sep 2003 12:24
Here is a small program full of comments I wrote for you when I read your question(it's below in the source button). It probably has more info than you need but will hopefully get you well on your way as far as basic sprite collision.

If you don't understand something look in the book that came with DBC.

Hope it helps

I've got DB Classic and PS Skillz and I'm not afraid to use um!
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 27th Sep 2003 20:08
Ok you gave me a very nice code but here is my main problem with like all codes. BMPs hate me. I can never get them to work with me.
In you code that you gave me I replaced this:



With:



Im probably way off, but if you are willing to help me out please do.
What I would like to do is replace the boxes with my images. After that, going from your code guidelines, I should be able to accomplish the rest on my own.

Thanks for your help
Nicolas

Future Company Name = Blazing Fire
Current Website Name = Blazing Fire
Future Number is Eleventy
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 27th Sep 2003 21:50
The proper syntax for the GET IMAGE command is
GET IMAGE img#,left,top,right,bottom

There are two ways you could change your code so it would work. The easiest is:



Or you can continue using the GET IMAGE command by declaring the dimensions of your bitmap. So say your image is 32*32 pixels. Your code would look like this:



I've got DB Classic and PS Skillz and I'm not afraid to use um!
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 28th Sep 2003 06:12
Hmmm.... Very interesting. I am learning but very slowly. You are helping me deeply and I appreciate it.

I got another problem/question.

you gave me this code:


It works great, but It just displays the same image hitting each other. I changed it and did this:


Well I changed the numbers on the other parts of code to match this and i still only got the same image hitting. I want one image hitting the other. I am still working on it but maybe you can post the answer. Out of all the collision posts that I have seen in all the forums here, you have given me the best info.
Thanks
Nicolas

Future Company Name = Blazing Fire
Current Website Name = Blazing Fire
Future Number is Eleventy
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 28th Sep 2003 09:19 Edited at: 28th Sep 2003 09:21
Without all the comments and with the changes you made the new code should look somewhat like this. (code below) You may have forgotten to update the img# on one of the SPRITE commands.



Otherwise I'm not sure. If this doesn't help solve your problem let me see your updated code so I can debug it for you.

I'm glad to help out. I'm learning as well, and only think it's right to help others the way I would like to be helped.

I've got DB Classic and PS Skillz and I'm not afraid to use um!
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 28th Sep 2003 19:28
Last night when you were logged off I think, well at least before you posted again, I figured out on my own how to do that.

For some reason it wasnt working with the
load bitmap
and
get image commands.

Worked fine with load image.

Maybe you can keep in touch with this topic of mine, cause you never know something may come up.

BTW: Do you use Classic or Pro? What do you think is better?

Thanks
Nicolas

Future Company Name = Blazing Fire
Current Website Name = Blazing Fire
Future Number is Eleventy
Erusuwasu
20
Years of Service
User Offline
Joined: 21st Sep 2003
Location: Where am I? I think I\'m lost...
Posted: 28th Sep 2003 19:43
I use darkbasic classic or DBC with the DARKMATTER package installed on top. DARKMATTER gives darkbasic classic multiplayer capabilities.

From everything I've heard darkbasic pro or DBP is the better one to use. It already comes with multiplayer capability and a substantial amount of COMMANDS were added to make life easier.

That's not saying DBC is bad or not capable of making a good game. It just means you have to work harder to get what you want when useing DBC sometimes.

I'll keep my eye out for you if you have any other problems later on. I was glad to help.

I've got DB Classic and PS Skillz and I'm not afraid to use um!

Login to post a reply

Server time is: 2024-05-05 15:51:22
Your offset time is: 2024-05-05 15:51:22