# Destructable terrain

**URL:** <https://forum.kirupa.com/t/destructable-terrain/47928>\
**Category:** Uncategorized\
**Created:** [April 8, 2004, 11:26am UTC](https://forum.kirupa.com/t/destructable-terrain/47928 "2004-04-08T11:26:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jr](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@Eric\_Jr](https://forum.kirupa.com/u/Eric_Jr)\
**Post date:** [April 8, 2004, 11:26am UTC](https://forum.kirupa.com/t/destructable-terrain/47928/1 "2004-04-08T11:26:45Z")

</div>

Hello everyone,

Most of you probably don’t know me, but I run a very poorly visited actionscript portfolio. Been active in Flash for some time in the past, and a hobbist scripter nowadays.

However, I’m facing a very annoying problem with ActionScript that I can’t seem to figure out. I’m creating somewhat of a game, which has destructable terrains. Since I am not a game developer, I have no idea how this principle works, but to use it with vectorized object, I did it as follows:

\*All the terrains in my game a created dynamically, and every corner in those object is stored in an array. A loop run past all the points, and draws the object (API). This enabled me to use hittest. When I shoot at the terrain, the positions of the (affected) points are shifted into the right directions. \*

The problem I am facing now, is that I do not want my terrain to be as static it is now. For example, (and this is critical in my game), I want to be able to shoot a circle in half… Look at this: (also gives more depth on my destructable terrain theorie)

_this is my circle_:  
 ![](http://junioronline.us/friends/stage1.gif)

_here is the point I am going to collide_:  
 ![](http://junioronline.us/friends/stage2.gif)

_the speed and mass of the bullet determen the range of affected points_:  
 ![](http://junioronline.us/friends/stage3.gif)

_finally the points are shifted_:  
 ![](http://junioronline.us/friends/stage4.gif)

This works great, I am pretty proud of this method, for it is fast, easy to calculate. However, my problem is when I shoot my circle in half, I cannot draw it correctly anymore. I need to be able to trace when I have more then one part, and split the array up into more arrays… Otherwise, the two parts will always be connected with each other…

I do not expect a solution, but I would like some of you to help me brainstorm. How can I construct this so that it works the way I want?

Everybody many thanks,

An oldy: Eric Jr.
