-
j00 r teh pwnz0r3d
Deformable Terrain
Ok, I'm working on a game, and I am hoping to turn it into a multiplayer game through polling (I know PHP)
This is the game...
http://thewebtank.staticsanime.com/fortress.swf
Well, I have an idea about how I would like to do it. Because making little particles make up the level would be way to processor intensive, I have decided to use a mask on the level... it is drawn through an API script and put into an mc called level. I would like to know if it is possible to put a mask over the level when a bullet shell hits and it let preceding bullets pass over that hole.
-
i dont know how, but if you add deformable terrain this will be EXACTLY like gorrials for qbasic, which was the best game ever!
-
j00 r teh pwnz0r3d
On bit 101s site, he has an example of deformable shapes with a mask, so I know its possible, but how do I go about this
-
Neoteric
well, just attach a circle mc and make it mask the land mc. and if you're hitTesting the bomb against land, then this should work. I have no idea though.
-
j00 r teh pwnz0r3d
Well... if you could possibly hook me up with code, that would rule... I'm a masking nub :|
-
ʞ33ƃ
another solution
One solution (cant remember who now) came up with was to:
Lets say you have a stage 400px wide. You create a land mc. Then inside that land mc you have 400 1px wide mcs. These are as tall as the land is (so itd be varied a bit from 1 to the other).
But you test if the bullet hittests the land mc. you would know wich pillar mc it hit cause of the _x. Then you subtract a little _height from each one around where it hit.
This was kind of a neat way to do this (i thought at leaste )
Nugget
-
i bet i could make an example based on "xMCNUGGETx" idea,if its sucessful ill post it today
-
j00 r teh pwnz0r3d
hmm... if that worked it would rule... but the thing is, api is simple as hell... but with ure idea it would own because u could have particle effects and stuff :O :O
-
well i was expirementing with it (the partical thingy), and i dont think as good as a idea as i thought it would be, because i just to test it i was using 10x10 blocks, and there were about 750 - 1000 blocks each having a onClipEvent(enterFrame) AND an hitTest, which makes it horribly slow (it was probably running less than 1 fps!!), and the final result would probably use 1x1 blocks instead so the terrain looks smoother, making it run 100x slower!! i know a better way, but you would have to name each individual block like block1, block2... and there would be approx 100000 blocks which would take too long so thats out of the idea. beat way is probably use a tile based map, or line to stuff (which i tried for about 10 min then gave up, but its possible). other than that i have no idea
-
ʞ33ƃ
all of the little terrain mcs should be inside 1 mc called land. you then just hittest land. you know which individual mc it hit based on the bullets _x property.
Nugget
-
j00 r teh pwnz0r3d
nugget, im gonna try this...
-
Senior Member
jtnw, i think that would be rather processor intensive. heres how i would go about it. you decide how you are going to divide your stage up, the more points you have across the width of the stage, the more processor intensive it will be, but less good looking and working less well. you then have a 'height map' which is a normal array with the relief of the land represented by _y coordinates in the array. to draw the land you use the draw API which in essence just joins up the dots in the height map. then you introduce projectiles, when these hitTest the land, (hittest is fine as there is only one projectile going at a time) you use some simple math to find the point in the height map it is closest too and then you reduce the height at that point by eg 5, you then can (to make it look better) also reduce the points around the collision point by less amounts, to get a more crater like effect. then you draw the level again, which will adopt the new destructed terrain as it is drawing from the altered height map. maybe in a minute i will make with some code
hth
[m]
-
Senior Member
wow, thanks johnjohnbongo, whereever you lurk! for sending me a cool bit101 fla that does pretty much the same thing! not quite the same as what im doing but a great help! ill have something to show soon people
[m]
-
j00 r teh pwnz0r3d
arg mbenney send it to me i needed that .fla!
-
Leave it with me 20 mins and I'll try to have something for you!!!
RipX
-
j00 r teh pwnz0r3d
RipX, if you could figure this out, you would be a goddess.
-
Senior Member
that fla is useless for your application, you cant define a heightmap, im almost done, bare with me!
-
j00 r teh pwnz0r3d
wait, mbeneey, r u making one that would work with my game?
-
j00 r teh pwnz0r3d
I'm almost done with one that is kindof like nuggets idea
-
Senior Member
Originally posted by DarkMagicHacker
wait, mbeneey, r u making one that would work with my game?
yeah baby, anyone know if gradient fill is possible with API?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|