hello! I am working on a small game and i would like to know how can I make a breakable ground? i mean... i tried using masks, but they can't "remove" a piece of ground, just add some. Anyone can help me?
hello! I am working on a small game and i would like to know how can I make a breakable ground? i mean... i tried using masks, but they can't "remove" a piece of ground, just add some. Anyone can help me?
At 1/30/06 08:50 PM, Louissi wrote: hello! I am working on a small game and i would like to know how can I make a breakable ground? i mean... i tried using masks, but they can't "remove" a piece of ground, just add some. Anyone can help me?
Can't you just have a "break animation, making the ground stop on a blank keyframe?
no, i am trying to make a ground like in the game "worms"
At 1/30/06 09:01 PM, Louissi wrote: no, i am trying to make a ground like in the game "worms"
So like something that breaks with multiple hits, kinda crumbles a bit each hit?
If that's what you want you could just have multiple frames.
//not exact code don't copy past be smart about it
if(hit){
this.Play;
}
then just put stop(); on each frame and each time it gets hit it will goto the next frame untill the last where you can put your breaking animation and you can just put your final stop(); on a blank frame. You'll also want to set that bit of code up as a function to save some resources in your game as well. One or two would be fine, but when you get up to 50+ you start seein some sizable lag. You may also wanna look into learning some tile based functions that can give you extremely large maps and what not without too much resource hogs and little worry of hitTests.
i know all of these things. Go play serious santa on the front page and you will understand. I want to do the same thing, but i wonder how.
www.gotoandplay.it has alot of tuts on this :P try downloading a source code.i think the hardest thing about it is that every peice of ground has to be api.
i dont think that serious santa uses API. I think its using a mask system but i can't figure it out. Anyone have an idea?
At 1/30/06 09:24 PM, Skeik_Sprite wrote: www.gotoandplay.it has alot of tuts on this :P try downloading a source code.i think the hardest thing about it is that every peice of ground has to be api.
ouch dude seriously if you don't have the experience don't even attempt it, you'll just drive yourself crazy.
me and bleeblap figured this out. put the ground in back of the background. and mask the background with a movieclip that takes up every spot of the frame except where the ground is. then instead of hitTesting the ground, hitTest the mask, and anly let it move if its touching the mask. and to "blow stuff up" just add to the mask, itt'l put the backround over the terrain in the areas you blew up, kinda. its hard to explain.
here's a sample
Arrow Keys: move
Mouse Click: make whole.
if you want the fla i could send it to you
i thinked about that too... maybe its the way it works. Ill try something and post here.
http://img73.imagesh..ge=caverntest7jz.swf
here is what i did. Like it? Thanks anyway.
At 1/30/06 09:24 PM, Skeik_Sprite wrote: www.gotoandplay.it has alot of tuts on this :P try downloading a source code.i think the hardest thing about it is that every peice of ground has to be api.
lol@ api
thats what bleeblap thought too for a while
At 1/30/06 08:50 PM, Louissi wrote: hello! I am working on a small game and i would like to know how can I make a breakable ground? i mean... i tried using masks, but they can't "remove" a piece of ground, just add some. Anyone can help me?
\
if the gound is a movie clip than make it so if your character hits the ground it goes to the next frame and so on until the movie clip has nothing at all, then your character will fall, easy enough
At 1/31/06 01:53 AM, ELFERRETO wrote: if the gound is a movie clip than make it so if your character hits the ground it goes to the next frame and so on until the movie clip has nothing at all, then your character will fall, easy enough
thats retarded, how would you make it so that its missing on the exact part on the next frame. your way is incredibly stupid.
At 1/30/06 11:37 PM, Louissi wrote: http://img73.imagesh..ge=caverntest7jz.swf
here is what i did. Like it? Thanks anyway.
oh thats just great. now someone HAS to make red faction in flash.
At 1/30/06 11:37 PM, Louissi wrote: http://img73.imagesh..ge=caverntest7jz.swf
here is what i did. Like it? Thanks anyway.
It's great. Did you use the reverse-masking thing?
\how did you do that ive been wondering how to do that for a while
a better way to do it (if you have flash 8)
with this way of masking: its limited
lets say you have the original ground, then the mask that acts as the destruction.
what if you then wanted to create ground, like building a bridge or sumtin, you would have to make a second ground movieclip (since the mask would effect it and would be bad) so youd then have to create another mask for that movieclip to act as destruction etc.etc.
if you wanted to have constant building and destroying youd have to have an unlimited number of clips:
however with flash 8, if you use BitmapData
you can destroy and create ground as much as you want and still have only the one bitmapdata
to destroy ground simply reserve a colour, and when you destroy, draw to the bitmap with that colour, then use threshold() to replace it with the background colour/ full alpha
then you simply use getPixel() to test for background colour, or with alpha you could also use bitmaps hittest using alpha threshold
At 1/31/06 09:23 AM, -dELta- wrote: to destroy ground simply reserve a colour, and when you destroy, draw to the bitmap with that colour, then use threshold() to replace it with the background colour/ full alpha
then you simply use getPixel() to test for background colour, or with alpha you could also use bitmaps hittest using alpha threshold
thats true i never thought of bitmap data.
At 1/31/06 09:23 AM, -dELta- wrote: a better way to do it (if you have flash 8)
yeah, why didnt i think of that myself! o.O
great, no api ^_^ it seems pretty easy compoard to what i thought, and serious santa may as well be a red faction. something like this could be used to make a great puzzle game.
lol i wish i was just able to make or get a decent moving engine like that one...
Neat, I was sure it had to be api too... I might try to implement this for the next version of my current game, if I ever make it (too far along now to backtrack and add that)
At 1/30/06 11:37 PM, Louissi wrote: http://img73.imagesh..ge=caverntest7jz.swf
here is what i did. Like it? Thanks anyway.
Reminds me of the very first lemmings game