00:00
00:00
Newgrounds Background Image Theme

PalmMan just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

breakable ground

2,933 Views | 33 Replies
New Topic Respond to this Topic

breakable ground 2006-01-30 20:50:10


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?

Response to breakable ground 2006-01-30 20:51:43


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?

Response to breakable ground 2006-01-30 21:01:51


no, i am trying to make a ground like in the game "worms"

Response to breakable ground 2006-01-30 21:12:24


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.


Our growing dependence on laws only shows how uncivilized we are.

Response to breakable ground 2006-01-30 21:19:57


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.

Response to breakable ground 2006-01-30 21:24:53


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.

Response to breakable ground 2006-01-30 21:32:16


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?

Response to breakable ground 2006-01-30 21:33:08


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.


Our growing dependence on laws only shows how uncivilized we are.

Response to breakable ground 2006-01-30 21:45:49


Comon, i am sure somebody know how to do that!

Response to breakable ground 2006-01-30 22:35:20


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

Response to breakable ground 2006-01-30 22:41:51


i thinked about that too... maybe its the way it works. Ill try something and post here.

Response to breakable ground 2006-01-30 23:37:40


http://img73.imagesh..ge=caverntest7jz.swf

here is what i did. Like it? Thanks anyway.

Response to breakable ground 2006-01-30 23:39:23


looks good.

Response to breakable ground 2006-01-31 01:00:49


Nice work, real worms like.

Response to breakable ground 2006-01-31 01:07:39


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

Response to breakable ground 2006-01-31 01:53:55


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

Response to breakable ground 2006-01-31 01:57:33


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.

Response to breakable ground 2006-01-31 02:12:04


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.

Response to breakable ground 2006-01-31 07:25:37


i will make something similar :).

Response to breakable ground 2006-01-31 07:27:41


not bad at all

Response to breakable ground 2006-01-31 07:51:34


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?

Response to breakable ground 2006-01-31 09:17:14


\how did you do that ive been wondering how to do that for a while

Response to breakable ground 2006-01-31 09:23:07


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

Response to breakable ground 2006-01-31 16:22:16


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.

Response to breakable ground 2006-01-31 16:24:01


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

Response to breakable ground 2006-01-31 16:37:42


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.

Response to breakable ground 2006-01-31 16:47:46


lol i wish i was just able to make or get a decent moving engine like that one...

Response to breakable ground 2006-01-31 16:55:08


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)


BBS Signature

Response to breakable ground 2006-02-01 06:55:24


You guys have any tutorials on bitmap data?

Response to breakable ground 2006-02-01 07:05:15


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