# Bitmap hittest question - Is this possible?

**URL:** <https://forum.kirupa.com/t/bitmap-hittest-question-is-this-possible/263725>\
**Category:** flash\
**Created:** [June 18, 2008, 5:27pm UTC](https://forum.kirupa.com/t/bitmap-hittest-question-is-this-possible/263725 "2008-06-18T17:27:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iceflyin](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iceflyin](https://forum.kirupa.com/u/iceflyin)\
**Post date:** [June 18, 2008, 5:27pm UTC](https://forum.kirupa.com/t/bitmap-hittest-question-is-this-possible/263725/1 "2008-06-18T17:27:12Z")

</div>

I am wondering if it is possible to make a flash duplicate of this game.  
[http://www.scorch2000.com/800x600.htm](http://www.scorch2000.com/800x600.htm)  
Also, note how land is destroyed in this PC game:

The feature Thats tricky is how the land is destroyed, and the tanks fall. I have looked at the bitmap API, and I didn’t find any way to remove pixels. Redraw the entire bitmap? Set pixels transparent and do a hittest like… psedocode if (hittested pixel == transparent) { keep moving tank down}

Any ideas?

---

<div class="post-metadata">

**Author:** ![iceflyin](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iceflyin](https://forum.kirupa.com/u/iceflyin)\
**Post date:** [June 19, 2008, 3:02am UTC](https://forum.kirupa.com/t/bitmap-hittest-question-is-this-possible/263725/2 "2008-06-19T03:02:35Z")

</div>

Actually, more to the point… Is using getPixel/setPixel practical performance wise for this task?

The hittest/checks to see if a pixel is visible or not wont take much processing.

---

<div class="post-metadata">

**Author:** ![substance](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@substance](https://forum.kirupa.com/u/substance)\
**Post date:** [June 19, 2008, 3:40am UTC](https://forum.kirupa.com/t/bitmap-hittest-question-is-this-possible/263725/3 "2008-06-19T03:40:48Z")

</div>

yes, in fact, if I remember correctly setPixel is the fastest way to render according to a blog post I read a while ago.

---

<div class="post-metadata">

**Author:** ![iceflyin](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iceflyin](https://forum.kirupa.com/u/iceflyin)\
**Post date:** [June 19, 2008, 3:46am UTC](https://forum.kirupa.com/t/bitmap-hittest-question-is-this-possible/263725/4 "2008-06-19T03:46:49Z")

</div>

OH WAIT! Maybe I’m overthinking this… Can’t I just take a transparent circle bitmap and overlay it onto the bitmap to remove visible land?

This formula on this page would also work:  
[http://livedocs.adobe.com/flex/3/html/help.html?content=Working\_with\_Bitmaps\_11.html](http://livedocs.adobe.com/flex/3/html/help.html?content=Working_with_Bitmaps_11.html)
