Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation example fix #1371

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ fn main() -> Result<(), String> {
let sprite_tile_size = (32, 32);

// Baby - walk animation
let mut source_rect_0 = Rect::new(0, 0, sprite_tile_size.0, sprite_tile_size.0);
let mut dest_rect_0 = Rect::new(0, 0, sprite_tile_size.0 * 4, sprite_tile_size.0 * 4);
let mut source_rect_0 = Rect::new(0, 0, sprite_tile_size.0, sprite_tile_size.1);
let mut dest_rect_0 = Rect::new(0, 0, sprite_tile_size.0 * 4, sprite_tile_size.1 * 4);
dest_rect_0.center_on(Point::new(-64, 120));

// King - walk animation
let mut source_rect_1 = Rect::new(0, 32, sprite_tile_size.0, sprite_tile_size.0);
let mut dest_rect_1 = Rect::new(0, 32, sprite_tile_size.0 * 4, sprite_tile_size.0 * 4);
let mut source_rect_1 = Rect::new(0, 32, sprite_tile_size.0, sprite_tile_size.1);
let mut dest_rect_1 = Rect::new(0, 32, sprite_tile_size.0 * 4, sprite_tile_size.1 * 4);
dest_rect_1.center_on(Point::new(0, 240));

// Soldier - walk animation
let mut source_rect_2 = Rect::new(0, 64, sprite_tile_size.0, sprite_tile_size.0);
let mut dest_rect_2 = Rect::new(0, 64, sprite_tile_size.0 * 4, sprite_tile_size.0 * 4);
let mut source_rect_2 = Rect::new(0, 64, sprite_tile_size.0, sprite_tile_size.1);
let mut dest_rect_2 = Rect::new(0, 64, sprite_tile_size.0 * 4, sprite_tile_size.1 * 4);
dest_rect_2.center_on(Point::new(440, 360));

let mut running = true;
Expand Down
Loading