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 –
Make a new movie clip entitled mountain
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…
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…
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… :-\
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.
*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.
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?
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: