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 / Collision question

Author
Message
Asterope
14
Years of Service
User Offline
Joined: 6th Feb 2012
Location:
Posted: 6th Feb 2012 21:42 Edited at: 7th Feb 2012 09:48
Hi mates,

I got a question regarding collision. I don't know if you guys know the old Tunneler game (http://www.youtube.com/watch?v=7J3q9nC69g0)? What I need is piece of code that does the collision for me, between the tank and the sand.

What I tried is making blocks which go down when you run forwards to them, it worked but I only could make like a hundred objects but wanted to make like 10,000 objects.



Second thing I tried is working with the bitmap. I'll copied the bitmap to the screen and I'll pasted the sprite over it when I stumbled on a camera issue that I couldn't solve.



So, in a nutshell, I need a solution for the removing of the sand when the tank hits the sand. I hope my explaining was clear.

Hope to hear from anybody!
Asterope
14
Years of Service
User Offline
Joined: 6th Feb 2012
Location:
Posted: 7th Feb 2012 21:33
Anyone??
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Feb 2012 01:06 Edited at: 8th Feb 2012 13:57
There are a few ways to do it. But firstly you need to paste the sprites, and then you can have unlimited holes.

One way to do it is with dims and data.

Data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,

Where a zero is a hole.

Another way to do it is with masks on a separate bitmap. here is an example, but the images are missing. You just need an image on top of another image, and when you paste a hole, you paste it on the back image as a colour. This then can be read as a hole.



Asterope
14
Years of Service
User Offline
Joined: 6th Feb 2012
Location:
Posted: 10th Feb 2012 11:35
Hoi mate,

Thanks for the reply, i am a little noob if your talking about data.
Howe do i use data??

can you give a little example

Login to post a reply

Server time is: 2026-07-09 21:19:42
Your offset time is: 2026-07-09 21:19:42