yet about destructable terrains
valdir salgueiro

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 :P, 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

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

yes its a 2d landscape, and it written using allegro and c, hope didnt forget about anything else :P

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

circlefill(backgrtound, x, y, r, makecol(255,0,255));

OICW

I fear that you'll have to give up using pixel mask unless you want to change the mask everytime you blow somethin up.

Richard Phipps

getpixel
Should be good enough.

Thread #586445. Printed from Allegro.cc