@@ -63,6 +78,20 @@ Some high-performance games even target higher frame rates, like 120 FPS or more
**Using flip()**: The pygame.display.flip() function updates the display, making all the drawn elements visible at once. Without it, changes to the graphics might not appear on the screen until the next update, which can lead to flickering or incomplete rendering.
**Lesson 4: Designing Game Characters**
**Objective**: Create characters and sprites for the game.
**Activities**:
Discuss character design principles.
Create and animate a character sprite.
**Interdisciplinary Links**: Art (character design, animation).
@@ -72,18 +101,3 @@ To achieve a nearly smooth running animation for a character, you typically want
**8 frames** can provide a simple running cycle, showing the character in different positions as they run.
**12 frames** or more will give a more fluid and detailed animation, capturing more nuances in the running motion.
For even smoother animations, you can use 15 to 24 frames, but keep in mind that this requires more artwork and can increase file size. The key is to balance the number of frames with performance and storage considerations in your game.
## Draw frames for animation in [Pixilart](https://www.pixilart.com/)
**Recommended Actions for Running Animation:**
To depict a running character effectively, consider these key actions for your frames:
**Starting Pose:** The character in a neutral position before starting to run.
**First Step:** One leg forward, arms in motion.
Mid-Stride: The character in the middle of a stride, with arms and legs extended.
**Second Step**: The opposite leg forward, with a different arm position.
**Full Stride:** The character fully extended, representing maximum reach.
**Landing Pose:** Character preparing to land with one leg down.
Recovery Pose: The character regaining balance before the next step.
**Repeat Cycle:** Return to the starting pose.
Using these poses will help create a smooth running cycle. You can also use onion skinning features in Pixilart to see the previous frames as you draw, which can help with consistency between frames.
@@ -55,3 +55,82 @@ _"path_to_your_images"_ should be either an absolute path or a relative path to
**Relative Path**: This is relative to the location of your Python script (e.g., images/picture1.png if the images are in a folder named "images" within the same directory as your script).
Make sure the path correctly points to your image files for the program to load them successfully.
## Principles of Character Design
Silhouette: A strong silhouette makes a character easily recognizable. The shape should convey the character's personality or role.
Proportions: Different proportions (e.g., large head vs. small body) can suggest age or character traits. Exaggeration can enhance expressiveness.
Color Scheme: Use colors that reflect the character's personality. Bright colors can indicate playfulness, while darker tones may suggest mystery or danger.
Facial Expressions: The face should convey emotions clearly. Consider how facial features can change to express happiness, anger, surprise, etc.
Costume Design: Clothing can tell a lot about a character’s background, personality, and role. Consider textures and colors that match the character's traits.
Backstory: A well-defined backstory can influence design choices, giving depth to the character.
Consistency: Ensure that the character maintains consistent features across different poses and animations.
## Designing a Walking/Running Cycle
Key Frames: A typical walking cycle has four key poses:
Contact (one foot touches the ground)
Recoil (the body lowers slightly as the weight shifts)
Passing (one leg moves forward past the standing leg)
High Point (the body rises again)
For running, the key poses are similar but more exaggerated.
Frame Count:
Walking Cycle: Usually 8–12 frames.
Running Cycle: Usually 6–10 frames, as the movement is faster.
In-Betweens: Fill in between the key frames to create smooth transitions.
Motion: Consider how the character’s body moves as a whole. Arms and legs should have a counter-motion (e.g., when the right leg moves forward, the left arm does too).
Designing a Running Character Using Pixilart
Create a New Project:
Open Pixilart and start a new canvas (consider a size like 64x64 pixels for a small character).
Sketch the Character:
Use a pencil tool to sketch the basic shape of your character in a neutral pose.
Focus on silhouette and proportions.
Define Key Frames:
Draw the key frames for the running cycle based on the principles mentioned.
Start with the contact pose, then draw the recoil, passing, and high point poses.
Add Details:
Once you have the key frames, add details like facial features, clothing, and colors.
Ensure that the design is consistent across frames.
Create In-Betweens:
Draw the in-between frames to smooth out the motion.
Focus on making the transitions fluid.
Animate:
Use the animation feature in Pixilart to test your running cycle.
Adjust timing and spacing to ensure the motion feels natural.
Export Your Animation:
Once satisfied with the animation, export it as a GIF or PNG sequence.
[Animating a Walk Cycle in Inkscape Part 1](https://www.spriteland.com/tutorials/animating-a-walk-cycle-in-inkscape-part-1)
## Draw frames for animation in [Pixilart](https://www.pixilart.com/)
**Recommended Actions for Running Animation:**
To depict a running character effectively, consider these key actions for your frames:
**Starting Pose:** The character in a neutral position before starting to run.
**First Step:** One leg forward, arms in motion.
Mid-Stride: The character in the middle of a stride, with arms and legs extended.
**Second Step**: The opposite leg forward, with a different arm position.
**Full Stride:** The character fully extended, representing maximum reach.
**Landing Pose:** Character preparing to land with one leg down.
Recovery Pose: The character regaining balance before the next step.
**Repeat Cycle:** Return to the starting pose.
Using these poses will help create a smooth running cycle. You can also use onion skinning features in Pixilart to see the previous frames as you draw, which can help with consistency between frames.