It has been awhile since the release of Flash 8. I've been looking around lately and have found a lot of experiments using things like Bitmap Data but no one really screaming "I've developed a game in Flash 8 using Bitmap Data which rocks!".
When I look around at things involving Flash 8, I'd say about 90% or more seem to be using the filters, the new video compression/components, or using the blends. The only thing people seem to be using Bitmap Data for is creating a bitmap tile based engine.
So, I'm curious:
1) Have you worked with Bitmap Data?
2) What do you think of Bitmap Data?
3) Can you see any application for Bitmap Data besides creating a bitmap-based tile engine?
Also, if you have found ANY other features besides the filters, the blends and the new video compression in Flash 8, let me know as well.
I think Bitmap Data has the potential to do some extremely cool things... I just need the time to develop something.
2) Fantastic, best feature added to Flash since dot syntax.
3) Hell yes! It opens up a whole world.
Sorry about the short glib answers
Naw, man, it's good to hear. I have 100% ideas but quickly learned you can't use traditional Flash techniques with it. Anymore than 15 - 20 bitmapData instances displayed in a movie clip on screen at the same time, and things get really slow.
However, I've found it is grand for tons of shapes vs tons of shapes environmental collision detection.
Also, one of the major complaints I've heard from people (You can't draw rotated, or scaled shapes), I've discovered you can "cheat it". If the Flash movie clip being rotated or scaled is a few levels down from the _root level (I.E. _root._mc._mc._mc._sprite), the draw command with draw it with the rotation and scaling intact.
Last edited by WilloughbyJackson; 05-25-2006 at 02:00 PM.
If the Flash movie clip being rotated or scaled is a few levels down from the _root level (I.E. _root._mc._mc._mc._sprite), the draw command with draw it with the rotation and scaling intact.
But then you're probably losing the benefit of bitmapdata.
...?
Not really. The only reason I checked that was someone said you can't do a bitmap hitTest with a rotated object, so I checked and I was able to create a rotating object which did an bitMap hitTest. It worked, and the rotating object could tell if it was hitting walls or not, pixel perfect.
Of course, one can also use the Matrix Transformation when using the Bitmap Draw command.
I've only just played around with it as well, and it looks interesting, but I haven't looked into it enough to really know what it can do.
If you use a matrix transformation on a bitmapdata movieclip's children (I asume all children are turned into bitmaps), will that work? Is that what you mean?
Another game application i've not yet seen is redundant shapes/mc's being stored on screen.
Example, you're in a fighting game and you beat up loads of opponents and they stay dead on the ground, after while the the extra movieclips will eat memory and slow the processor.
Using bitmap data you can commit as many images to it as you like without slowdown :-)
Also useful for bullet holes, burn marks etc etc. You can have as as many of them as you like persist forever.
Yep exactly. There are so many doors open now it's untrue ( I'm panting to do a true F8 game ).
Even silly little things like being able to take a snapshot in game and display that again ( I dunno, say you're playing a beat em up, and you get that killer punch in, be cool to snapshot that and use that as a background to the stats screen ) are all stupidly easy now.
* Improved workflow. Designers can design, and coders can just pull in the images for external png's etc.
Getting near the dream of not having a designer anywhere near a fla.
* User enabled content. Written a worms game with a nice textured terrain ? Let users upload their own as a simple image file and get the engine to load it in.
* So much potential for sFX it's untrue. Looking at this grab from my X game:
Done with a mask and a duplicated pre-distorted image, all that could be done on the fly ( And a lot better as well ).
someone talked about bitmap hittest
being a phys lover i played around with it a bit to find possible collision detection methods, but it turned out 2 be 2 slow for real-time and many objects
see the attached file (click the ground to erase it)
I've only just played around with it as well, and it looks interesting, but I haven't looked into it enough to really know what it can do.
If you use a matrix transformation on a bitmapdata movieclip's children (I asume all children are turned into bitmaps), will that work? Is that what you mean?
I haven't messed with the transformation matrix in great detail, however, here's what I know so far.
The matrix can be applyed to a bitmapData movie clip itself (as in the entire bitmapData) which would effect all the children or a movie clip. However, when using the "draw" command to copy something from a movie clip or from a bitmap to a bitmapData field, you can apply a matrix at that time, meaning only whatever is being copied will have an effect on it. This allows you to manipulate individual elements as you add them to the bitmapData using the draw command.
Originally Posted by lesli_felix
Another game application i've not yet seen is redundant shapes/mc's being stored on screen.
Example, you're in a fighting game and you beat up loads of opponents and they stay dead on the ground, after while the the extra movieclips will eat memory and slow the processor.
Using bitmap data you can commit as many images to it as you like without slowdown :-)
Also useful for bullet holes, burn marks etc etc. You can have as as many of them as you like persist forever.
Yep, I was always thinking that, however, as I mentioned earlier, you can't have too many bitmapData instances displayed on the screen (i.e. attached to a movie clip). This means that depth sorting things could be tricky IF you are doing it the traditional way with multiple movie clip and swap depth using Y.
someone talked about bitmap hittest
being a phys lover i played around with it a bit to find possible collision detection methods, but it turned out 2 be 2 slow for real-time and many objects
see the attached file (click the ground to erase it)
It all depends on how you do the test. BitmapHittest is good for one verse many (I.E. tons of bullets on screen each of which will kill you... one test versus many). However, I so far, I have found getPixel seems to be a very fast for doing an simple test to see if you hit something or not. (I.E. walking on terrains, etc..)
I'm once again in a place without Flash 8, so I'll take a look at that when I get home.
(Or you can post your code here so I can read it right now)
"as I mentioned earlier, you can't have too many bitmapData instances displayed on the screen "
Yeah, but you'd just draw it directly onto the "background" bitmap, no speed lose at all, aside from the intial plotting it incurs no performance hit at all
Based on tonypa's destructible terrain engine (notice how you can destroy the landscape by clicking on it). This has pixel-perfect collision detection. And, via clever use of for loops, you won't skip through 1-pixel-thin columns of terrain when moving at high speeds. Plus, you don't sink into the ground when falling at high speeds, and it runs quickly because it's getPixel()-based instead of using shapeFlag hitTests. All in all, I reckon it's a pretty solid engine which I could take in any direction.
Do you think that beginBitmapFill() could be used to add a pattern to the bland landscape? Obviously I could've just used the paint bucket tool in Photoshop when I was making the level, but I'd like to have the option of dynamically adding terrain to the landscape, with Flash texturing it as it's added.
Ah, that could work, yes. Would there be a way to have certain colours of the terrain act as masks for separate bitmaps (a grass bitmap, a mud bitmap, a stone bitmap, etc)?
i did have collision detection and reaction using while loops, but i'm convinced i can do it with getColorBoundsRect which is the rectangle you can see. I kinda have it working, just gotta figure out how to handle x collisions and their reactions.