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 / Destructable 2D Terrain

Author
Message
Whisper Wind
21
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 8th Jan 2004 02:59
I've always wondered how to do this and I think I've got some idea. I can think of only 2 ways to do this. One would be to set a certain exact color as "blank space" and draw that color to the screen after an explosion has occured that would deform the terrain. This method would, however, require pixel-perfect collision which I really don't know how to do. The other method would be storing "blank spaces" in a dim(800,600), but I would imagine this to be very slow and memory intensive. Does anyone have any good ideas? Am I going at this all wrong?
diablo fan
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: michigan usa
Posted: 8th Jan 2004 03:11
you might ask in the regular forum its over my head

me
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 8th Jan 2004 03:17
Use memblocks to deform the terrain image

RPGamer


We need help! Email us! join@eternaldestinyonline.com
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 8th Jan 2004 03:32 Edited at: 10th Jun 2004 20:23
I am just about to do this in a worms clone I am making.
I am currently going to use an array for each pixel in the game area. I think I am going to store the colour of the pixel in the array for easy drawing of the image. Then just use a memblock to make the image from the data in the array.

It uses quite a lot of memory, an array(3071,767) and a 1024x768 memblock.
I think I should be able to keep the speed at a resonable level without too much clever code.

Unfortunatly it will also require I write some pixel perfect collision routines. I think there are a couple about that others have writen, check the codebase and code snippets forums.

I recently wrote a space invaders type game that uses a similar technique for the shields, the shields are much smaller so speed is obviously less of a problem.
http://winch.dbspot.com/space_inv.php
link is down atm.

can i scream

Login to post a reply

Server time is: 2024-11-25 23:19:07
Your offset time is: 2024-11-25 23:19:07