Creating Objects for ffilmation
Adding objects to a scene is very similar to the process for adding a character. According to the documentation the only difference is that objects are static, and they require less memory resources from the engine to exist on the stage.
You can use any method to create the graphics that make up an object. I used a prop in Poser and set it to an angle that I hoped would fit in my layout. You can create multiple angles using the same method as with characters. Keep the pixel dimensions of the object bitmap as small as possible – I keep a high-res version and make smaller copies from it. Make sure to set the export properties so that ActionScript can find it:
You can store multiple objects in a single fla/swf. I approach them as any shared library – you can organize libraries by project, theme or other principle that meets your project’s requirements. They don’t have to be placed on the stage as I’ve done either.
Create a definition file for your library to enable ffilmation to utilize it. The name should be the same as the swf name, only with an .xml extension. Here is a sample:
<?xml version="1.0" encoding="utf-8" ?> <definitions> <media src="../media/medicalProps.swf"/> <objectDefinition name="LabTube"> <displayModel> <sprite angle="0" src="LabTube"/> </displayModel> <collisionModel> <box width="116" depth="70" height="200"/> </collisionModel> <shadowModel> <shadow type="sprite"/> </shadowModel> </objectDefinition> </definitions>
Then you must add the library swf and object definition to your scene definition file.
In the head section add this:
In the body section:
<object id="labTube" definition="LabTube" x="422" y="224" z="0" orientation="0"/>
You will probably need to experiment with a few details of your object: the location of the origin in the MovieClip and the collision area shape and dimensions. If you see light between the bottom-most parts of your object and/or weird Z-sorting, the origin is probably too high. I set mine near the bottom and center. I start the collision shape and dimensions that match as closely to my bitmap pixel dimensions and then test with a character in the game.
If you use png format when importing bitmaps your game will look better in low quality, since the quality setting will not effect their display, unlike shapes. Compare the gurney to the vacuum chamber in the screenshot. Also notice the built-in support for transparency in the object and the shadows, and Z-sorting.