Introduction
Here you'll learn the basic of composing character with multiple parts, improving your job and making source files smaller.
This smart solution is not new, old games from PSX, Arcades, NES, SNES, SEGA, ATARI, and much other gaming systems used this strategy to reduce the source size of their games.
Now, it's your time to learn and practice.
Alignment Points
The first thing you'll need to be introduced is the alignment points.
They are 9 basic points, going from Upper/Left to Bottom/Right.
The mostly common align point is the middle point, and it's standard on C2 for new sprites.
On platform games you should use the Bottom/Middle point, and will need make your sprites rationally before importing it to C2.
Main character poses
Let's start practice, and to help you, here's a small strip of a character.
To achieve a character sprite like this, you can draw the animation as a GIF, it's a good way to achieve a smoothly animation, and after the job, simple import it to C2.
The first tip, when doing the GIF, is make the image size bigger than the sprite size inside it, 2 times bigger is sufficient.
The second tip, make your character in layers, use one for the pants, one for the hair, one for the equipment, etc.
*This is very important, if you don't align it right, the game will enunciate this misalignment when in motion.
The last tip, and not less important, after the animation done, make it aligned to the Bottom point.
Now, export all the frames of your animation for individual PNG files.
If you like to maintain your source file small, you can compact these PNG's to 8bits, 16bits or maintain the original quality and size (32bits of colors).
Secondary poses
Following that philosophy, you may want add some tools for your character, and this can be done doing the same animations, drawing the tools on separated layers, exporting them on new PNGs.
After finishing the attack poses, the main character will use these sprites:
And the layer where you'll place the sword:
Notice, the sword frame width is larger than the character frame width.
This is important later, to check collision with another objects.
Importing to C2
After finishing the template of your sprites, import them to C2
- Set the origin point to the Bottom
- Set the same collision box for all animations
- Create the platform to your Player object.
On a new object, import the sword frames, and make two different animation, the first is the Standing animation, where you'll place the invisible frame, the second animation is the sword in action.
- Set the origin point to the Bottom
- Set the same collision box for all animations
- Create the Pin behavior to your sword object.
- Set this object coordinates to another object (Player - Origin)
- Set this object to Pin to the Player (follow this sequence).
After working on your code (I pretend to improve this tutorial with screenshots and step by step for this code), you'll need to know these steps to show the sword at the same time of your "player sword" animation:
- Pressing the action Key, example "Space Bar", play the player sword animation, play the sword animation;
*Check if the player is not using this animation for the standing and walking poses, so, the player will play the sword animation without trouble.
- After finish of these animations, play respectively "standing" poses for player and sword.
Download the Sample CAPX
Think out of the box, for sure you'll like!
Advanced codes can be added, you can check if the sword, when playing the "sword" pose, is touching a family, and if yes, make it damage the object, and much other things.
Have a good day, and I hope you enjoined it.