Is it possible to create (good) flash animations in flash builder?
I know that all the cool animations are created in Flash (the program) unfortunately, I am not very good with it. However I like flash builder, because you can use a markup language and because it开发者_StackOverflow is better optimized for large projects.
Can you create animations that are as good in flash builder?
Flash Builder and Flash each have their appropriate uses. While you technically can make good applications with Flash and good animations with Flash Builder, it's much harder than using the appropriate tool for the job.
If all you want to do is programmatically move some sprites around the screen, Flash Builder will work fine. If you want more complex stuff that you want to build visually, it will be easier and better with Flash.
It depends on what you mean by "as good."
Certain animations, like transitions and object movement (tree node opening/closing, etc.), can be very sophisticated and are actually easier to do programatically.
For other effects, like football players running across the screen, you are probably not going to be able to do them well, if at all, in FB.
Take a look at one of the more popular tweening engines, TweenLite: http://www.greensock.com/tweenlite/
It can create pretty complex animations purely in code, however for things like character animation there's nothing beats the good old timeline + a bit of onion skinning.
Really, if you want to make animations by hand, rather than programmatically, Flash is the answer. Give them both a whirl. They work well together. You can program in Flash, but it's a little weak in that area. Things might have improved since I last used it. Flash's strength is in actually creating graphics and animations.
Flash Builder on the other hand is an Eclipse based environment, and is specifically for programming/debugging/profiling/ui layout - like VS, Eclipse or Netbeans: Not really what I would call an animation tool. But you can certainly make things move/rotate etc, and load or embed animations in SWF format.
The docs explain how to embed external assets in Flex here - including swfs: Embedding Asset Types
Animations are more difficult to achieve in Flash Builder, but overall if you are designing a game I've had great success with Flash Builder.
I suggest working with the Starling Framework as it provides many native tweens for achieving movement of your onscreen assets, as well as fading, coloring, spinning, and all types of tweening translations (from linear to bouncing effects). If you would like further sprite manipulation there are several options. The most popular (which Starling has demos of) is animating frame by frame using Movie Clips. This is where you would update a graphic frame by frame for several iterations to make it appear as though it is animated. You'll need a good artist for this.
Your implementation on this is going to be defined by how many assets you need to animate though. Mobile devices are very limited in GPU heap space, so you have to choose what image assets to load carefully. The use of a single sprite sheet per scene you plan on rendering will help keep your memory under control. Texture Packer is a great tool that plays very well with Starling. I love using sprite sheets because they are easy to update for each scene (texture packer really does a great job at squeezing them together) and you only have one asset to manage instead of hundreds of individual sprites. Texture Packer generates an XML document that the Starling engine can read and provide access to each item. Best of all, you reuse textures this way. So two buttons with the same referenced image in a sprite sheet share the same graphical asset in memory. This results in a nice speed bump for your application as well. Reading a single sprite sheet is way faster than opening a connection to hundred of graphical assets.
What I've done in the past and currently with great success is having two types of sprite sheets. Dynamic and Static. Static sprite sheets load when the game first opens and contains artwork the game will use on all scenes. This sprite sheet is typically small, but has game logos and other required artwork. Dynamic sprite sheets are loaded for each game scene. They load and unload for each scene that requires them.
Example game with animations, and many -many sprite sheets. Also uses the physics engine called Nape. Combined I was able to make a very good flash game for iOS and Android. Game is called, Offroad Nation.
Some example code in my asset loader. This function is called when every scene in game loads. Each scene is a case statement and lists the sprite sheet(s) it requires. A memory purge happens first, then the required sheets for the scene are loaded. This takes a few seconds and is a good place to show a loading bar and an ad.
public function loader(e:AssetLoaderEvent):void{
/**
* remove all resources
*/
this.purge();
trace("Menu Code: ", e.menuCode);
switch(e.menuCode){
case C.ALE_OPENMAINMENUSCENE:
case C.ALE_OPENGAMESCENE:
this.addAtlas("atlas_gamescene");
break;
case C.ALE_DEVELOPERMENUSCENE:
this.addAtlas("atlas_gamescene");
this.addAtlas("atlas_leveleditor");
break;
}
}
精彩评论