[Tutorial] How to add a new Sprite Sheet on As3 Client
How to add a new Sprite Sheet
Well, uh lets begin lol
First, you need to take a current sprite sheet and erase all of the contents of it and replace it with the new contents or whatever it is you are adding to your new sprite sheet.
For this particular tutorial I'll be creating 8x8 characters and will be using "Embeds_chars8x8dHero1Embed_.png" as a template.
Step 1:
Once you have added everything on your sprite sheet go all the way to the src directory, right click and New>Actionscript Class and fill in the name of your sprite sheet.
Step 2:
Add this code to the ActionScript class you just added for your sheet.
this will embed the sprite sheet you add in your client so it can be used
Step 3:
Get the your sprite sheet and add it to your client by dragging the png file to the src directory.
Step 4:
Now go to com>company>assembleegameclient>util>loadEmbeds.as
and find this
and under it paste this
then find
and under it add this
Step 5:
If you are making a 16x16 sheet then go to
and take only the
part and replace with the
(it wont move but you'll et the point. lol if you need it to be animated just go take the one from an animated sprite sheet and replace. If you do it wrong it could cause some buggy stuff to be happening with some sprites u add in it)
Step 6:
Finally add it in your server xmls like so
there ur done lul
To make it look cleaner you can perhaps add that Embeds_ to your sheet hardly think its neccessary since I believe its there to seperate the class from the actual sheet and doesn't make a difference in the client.
Well, uh lets begin lol
First, you need to take a current sprite sheet and erase all of the contents of it and replace it with the new contents or whatever it is you are adding to your new sprite sheet.
For this particular tutorial I'll be creating 8x8 characters and will be using "Embeds_chars8x8dHero1Embed_.png" as a template.
Step 1:
Once you have added everything on your sprite sheet go all the way to the src directory, right click and New>Actionscript Class and fill in the name of your sprite sheet.
Step 2:
Add this code to the ActionScript class you just added for your sheet.
Code:
package
{
import mx.core.*;
[Embed(source="nameofyoursheet.png")]
public class nameofyoursheet extends mx.core.BitmapAsset
{
public function nameofyoursheet()
{
super();
return;
}
}
}
Step 3:
Get the your sprite sheet and add it to your client by dragging the png file to the src directory.
Step 4:
Now go to com>company>assembleegameclient>util>loadEmbeds.as
and find this
Code:
public static var innerP2MaskEmbed_:Class = Embeds_innerP2MaskEmbed_;
Code:
public static var nameofyoursheet:Class = nameofyoursheet;
then find
Code:
_0B_c.add("chars8x8rHero1", new Embeds.chars8x8rHero1Embed_().bitmapData, null, 8, 8, 56, 8, _lJ_.RIGHT);
Code:
_0B_c.add("nameofyourspritesheet", new nameofyourspritesheet().bitmapData, null, 8, 8, 56, 8, _lJ_.RIGHT);
If you are making a 16x16 sheet then go to
Code:
AssetLibrary._05q("lofiProjsBig", new Embeds.lofiProjsBigEmbed_().bitmapData, 16, 16);
Code:
16, 16
Code:
8, 8, 56, 8, _lJ_.RIGHT);
Step 6:
Finally add it in your server xmls like so
Code:
<Object type="0xa97" id="Energy Staff">
<Class>Equipment</Class>
<Item/>
<Texture>
<File>nameofyoursheet</File>
<Index>0x70</Index>
</Texture>
<SlotType>17</SlotType>
<Tier>0</Tier>
<Description>A magical wooden staff topped with a white crystal.</Description>
<RateOfFire>1</RateOfFire>
<Sound>weapon/fire_wand</Sound>
<Projectile>
<ObjectId>Grey Missile</ObjectId>
<Speed>180</Speed>
<MinDamage>10</MinDamage>
<MaxDamage>30</MaxDamage>
<LifetimeMS>475</LifetimeMS>
<Amplitude>0.5</Amplitude>
<Frequency>2</Frequency>
</Projectile>
<BagType>0</BagType>
<NumProjectiles>2</NumProjectiles>
<ArcGap>0</ArcGap>
<OldSound>magicShoot</OldSound>
</Object>
To make it look cleaner you can perhaps add that Embeds_ to your sheet hardly think its neccessary since I believe its there to seperate the class from the actual sheet and doesn't make a difference in the client.