[fmx] Destructable Ground

Ok, first <a href=“http://www.NeptuneCircle.com/id/cannonv3.swf”>click here to see what I have so far</a>. That way you’ll know what I’m talking about.

Ok. Now my question is, is it possable to program it so that if your cannon hits mountain , it will take a chunk out of where ever it hits. I dont want one hit to kill the whole mountain, just take out the area that you hit.

Well… After reviewing what I know in Flash… I figured out something I don’t like about it finally… Unless it’s just hidden and I don’t know where it is…

Object manipulation through code… Being able to change the way something looks by saying…

reDraw( rectangle, 10,10,200,200 );

I miss those days… lol That was the one god thing in C++… But… For Flash… As far as I know we can’t really do that… So buddy… I’m gonna suggest this alternative method…

– Procedure –

  1. Make a new movie clip entitled mountain

  2. Open this movie clip up… Start making the mountain in small chunks… A chunk here, a chunk there… Get my drift? Make the mountain in small pieces…

  3. Just make their instant names alike… p1, p2, p3… That way your loop is easier to define.

4 Do hitTest’s on the mountain… And if the bullet collides with the mountain… BOOM… Off goes that one piece…

It’s not the fastest or most realistic way of doing it… But at least it’s something… I’m working on another way of doing realistic terrain here… Hopefully I’ll get something to look right…

Peace

Seeing as how you are working on a game that I programmed in C++ and know alot of the questions you are asking…

Do you have MSN Messenger or Yahoo Messenger?

It would make it alot easier for you and we could tlak about this destructable ground theory… I might have figured out a better way to do it… But I’m not sure yet… :-\

MSN : mentalconcepts@hotmail.com
YAHOO : playamarz

E-Mail : mentalconcepts@hotmail.com

I have a few ideas.

First of all, I get a 404 from your link so I don’t know exactly what you want, but I’m imagining something like the old artillery games.

What you could do to take chunks out of the terrain is to draw over it with the background colour. You could have premade “chunks” in the library, or you could use the API to draw them with randomized jagged edges or something. So with a hitTest you’d know where the projectile landed on the terrain, then just pop up the chunk there.

Another option is to have a mask that pops up. You could also do this on the fly with the API since MX now supports dynamically assigned masks.

One final thought is to make the terrain using the API to start with, then when a projectile hits it, you can redraw the terrain with a hole in it.

Just some thoughts. :slight_smile:

-Al

*Originally posted by playamarz *
**Well… After reviewing what I know in Flash… I figured out something I don’t like about it finally… Unless it’s just hidden and I don’t know where it is…

Object manipulation through code… Being able to change the way something looks by saying…

reDraw( rectangle, 10,10,200,200 );

I miss those days… lol That was the one god thing in C++… But… For Flash… As far as I know we can’t really do that… So buddy… I’m gonna suggest this alternative method…**

The drawing API in Flash MX can do something close to that.

There is a tutorial in the AS Tricks section of this site if you want to check it out.

Sorry about the 404, i fixed it.
I’ll look into some of those ideas and my YahooIM name is Psykloak1 Email - Psykloak1@aol.com

WELL NO THE FUNKDIDLY WONDER!

I’ve got Flash 5… Which obviously sucks major shlong n balls compared to Flash MX… lmao

Thank you very much for clarifying that Beta… Now I can start hardcoring this Flash scene again… lmao

Actually I just need to get a book on Flash stuff… I hate looking at stuff online.

Again Thanks… :slight_smile:

<< gets in truck and goes to dad’s house to download some stuff >>

Ok, I learned how to use the draw API to draw the ground. Thats some cool stuff. but how would I make a dent in it when its hit? I can think of some ideas but what do you all think?

I fixed up the random level maker, <a href=“http://www.neptunecircle.com/id/cannonv4.swf”>check it out here</a>. That draw thing is really neat.

Ok, here is my idea for the destructable ground when the cannon ball hits one of the lines of the mountain, the line will split into two lines and form an angle. Here is an example ofwhat I mean:

<img src=“http://www.neptunecircle.com/misc/pics/ex1.png”>
this is the mountain before it gets hit

<img src=“http://www.neptunecircle.com/misc/pics/ex2.png”>
here is it after

<img src=“http://www.neptunecircle.com/misc/pics/ex3.png”>
I could even take it one step further like this

I havent implamented this yet, just theory, any ideas on how to do it or a better way all together?

My good buddy… By tomorrow afternoon… I should have a wokring destructable ground for you…

I just checked out the DRAWING api of Flash… And I know a way to make it as smooth as butter and near realistic as well…

Peace

*Originally posted by playamarz *
**My good buddy… By tomorrow afternoon… I should have a wokring destructable ground for you…

I just checked out the DRAWING api of Flash… And I know a way to make it as smooth as butter and near realistic as well…

Peace **

Really. mm, cool.