Add Update Animation Usage Example#751
Conversation
- C++, C# (top-level + OOP), and Python implementations - Demonstrates color cycling animation using update_animation() - Sprite sheet created programmatically (no external bitmap needed) - Includes animation script resource file (color_cycle.txt) - Screenshot of window output
❌ Deploy Preview for splashkit failed.
|
222448082Ashen
left a comment
There was a problem hiding this comment.
Peer Review
I've reviewed the update_animation usage example (PR #751).
Checks
- All required files are present.
- Example Title (.txt): update_animation-1-example.txt
- C++ code: update_animation-1-example.cpp
- C# code (top-level statements): update_animation-1-example-top-level.cs
- C# code (Object-Oriented Programming): update_animation-1-example-oop.cs
- Python code: update_animation-1-example.py
- Screenshot:
update_animation-1-example.png(shows 4-color cycling animation) - Resources:
update_animation-1-example-resources.zip(contains animation script)
- Code correctly uses SplashKit functions.
- Code clearly demonstrates the function.
- All versions maintain the same structure and comments.
Code Tests Done
- C++ code ran correctly creates sprite sheet programmatically, loads animation script, cycles through colors using
update_animation(). - C# top-level code ran correctly mirrors C++ logic with correct SplashKit API naming.
- C# OOP code ran correctly object-oriented approach with proper method chaining (e.g.,
sheet.FillRectangle(),anim.Update()). - Python code ran correctly follows SplashKit Python conventions (e.g.,
clear_screen_to_white(),refresh_screen_with_target_fps()).
Website Tests Done
-
npm run buildPassed successfully; all setup scripts completed without errors. -
npm run previewUsage example displays correctly under Animations category; JSON metadata correctly links to/api/animations/#update-animation; resource file accessible.
Osaid2993
left a comment
There was a problem hiding this comment.
The overview and example itself look clear to me and the explanation matches the function well.
My only remaining concern is that the PR should stay limited to this example only. Please remove the unrelated changes from scripts/json-files/usage-example-references.json, then I’m happy to review again.
Scope this PR to update_animation only. Drop unrelated additions for saturation_of, rectangle_around, bitmap_center, draw_circle, get_font_style, close_window from usage-example-references.json.
|
@Osaid2993 thanks for the review! I've removed the unrelated entries from |
rachelpatrao
left a comment
There was a problem hiding this comment.
The usage example is well-structured and clearly demonstrates how update_animation works within a game loop. The implementation is beginner-friendly, keeps the code minimal and focused, and the inclusion of consistent cross-language versions, resources, and documentation makes the example easy to follow. Approved!
Overview
This usage example demonstrates
update_animationby showing how an animation progresses through its frames inside a game loop, cycling through different colors.SplashKit Function:
update_animationFiles Included
What the Example Does
option_with_animationto select the correct frameupdate_animationto advance to the next frameDesign Decisions
create_bitmapandfill_rectangle_on_bitmap, avoiding the need for an external image file. This keeps the resource bundle minimal (only the animation script).update_animationwith the fewest lines possible while remaining clear and beginner-friendly.Usage Example Checks
npm run buildpasses (no new link validation errors)