|
yet about destructable terrains |
valdir salgueiro
Member #7,468
July 2006
|
i´ve read some threads about this subject, but i haven´t seen was how it was going to be in the code i know that you draw a circle ow watever u wnat with 'magic pink' .. but where do i draw it? does it have to do with put pixel()? and getpixel()? i didnt get this point... also ive seen some code snipets (thats why i didnt 'got' how it works , cause what ive seen is incomplete), and was wondering why is it necessary to have more than one backgrtound (usually foreground and background) thanks! |
Onewing
Member #6,152
August 2005
|
Using the pumping lemma, I can make enough assumptions to assume that you are using a regular language, however unclear it may be. Sorry, just being an a**. Anyway, I guess you mean a 2D landscape, yes? The magic pink that you refer to is makecol(255,0,255). This special guy is transparent. If you have a background bitmap with your...background, you can draw this to a buffer first. Then, you draw your foreground bitmap with the...foreground on to the buffer. Then buffer to the screen. The background will be completely solid (no magic pink) and the foreground will have magic pink where ever you want to see the background. Thus, to have destructable terrain, you just put the magic pink down where ever you are blowing up the foreground, and you will then see the background behind this spot. Cool? ------------ |
valdir salgueiro
Member #7,468
July 2006
|
yes its a 2d landscape, and it written using allegro and c, hope didnt forget about anything else ok, but how do i 'draw' the magic pink, i prolly will use pixelmask as my library to do the pixel collision, but what i dont get is how it to change the actual shape of my background, so the colision would be different (there would be more holes) |
miran
Member #2,407
June 2002
|
circlefill(backgrtound, x, y, r, makecol(255,0,255)); -- |
OICW
Member #4,069
November 2003
|
I fear that you'll have to give up using pixel mask unless you want to change the mask everytime you blow somethin up. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
Richard Phipps
Member #1,632
November 2001
|
getpixel |
|