-
Patron Saint of Beatings
[Flash 8] copyPixel animation and Accessorizing
Conceptually, it is based on a technique I used in Director to animate the bunnies in my King of the Bunnies game (which I remember posting on this board a lifetime ago).
http://willoughbyweb.com/sprite/gohen.html
This is something similar to what Senocular has done; however, I didn't download his source file until after I finished. However, I took it a step further and allowed the Gohan sprite to be accessorized.
The basic technique takes a sprite-sheet, copies a certain sprite on that sheet and places it on stage. After a certain amount of time, it will display another sprite from that sprite-sheet.
To do the accessorizing, first, I opened the sprite-sheet in Photoshop. Then I drew all the accessories in different layers and exported them individually.
Whenever an accessory checkbox is clicked, it adds that data to an object, and then cycles through the object’s accessory data and copy pixels that overtop the sprite-sheet.
DOWNLOAD SOURCE: http://willoughbyweb.com/sprite/gohen.fla
-pXw
-
ism
cool. sprite sheets are a whole lot smaller than multiple images too
Graphics Attract, Motion Engages, Gameplay Addicts
XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro
-
Senior Member
I like the idea
Have you tested the speed of this? Would it be faster to place bitmaps in frames and let Flash run through them?
-
Patron Saint of Beatings
Originally Posted by tonypa
I like the idea
Have you tested the speed of this? Would it be faster to place bitmaps in frames and let Flash run through them?
I've only speed tested it verses what I tried to do awhile ago, which was a vector based "change how your character looks" type game. The more accessories that are visible, the slower the characters started to become. When I tried using pieces of bitmaps, it often resulted in the ugly: "looks like a cut up bitmap look".
This allows you to add as many accessories as you want to the character and then assemble the sprite-sheet on the fly. Since it's always just copying from the spritesheet, there's no issues really with too many movieclips on-screen.
I'll do a speed test version just the bitmap alone tonight.
-pXw
-
Senior Member
That's hot. I'm interested in hearing about speed differences.
-
Patron Saint of Beatings
This is the sprite animated using the timeline:
http://willoughbyweb.com/sprite/gohenO.html
This is the sprite using the draw/copyPixel style:
http://willoughbyweb.com/sprite/gohenX.html
Let me know the FPS, okay?
-pXw
-
ism
just about exactly the same fps for both. 23-26
Graphics Attract, Motion Engages, Gameplay Addicts
XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro
-
SaphuA
Yup same fps for both..
I don't think such a small thing will have much impact on the player, there should be something bigger to check. Maybe a bigger image (more alpha) and more sprites?
-
Yes we can
nice one =)
and yeah,saphua is right, for a performance comparison set the movie to 120 fps and fill it with as much performance intensive things as possible, so really big sprites with lots of alpha areas,lots of elements placed on top of each other etc.
-
Patron Saint of Beatings
Okay... I'll do that later Tom.
-
Using BitmapData should be faster or you have a lot of work to do.
For example, you could create all possible arrangements of addons like the sword etc. in movieclips. This should be the fastest way, but it's not very good if you have about 10 addons
The other way - slower - creating the sprite and addons dynamically in movieclips. Should be a little bit slower than the first method.
For fast and dynamic use the BitmapData is in this case absolutely perfect. You can precalculate all (!) animations for example and just load them if needed. This would be the fastest way imho.
Another possibility is not precaching every (possible) frame and generating the bitmap/animation at runtime. I think WilloughbyJackson is doing this. So you could gain a little bit more speed by precaching everything.
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
|