changeset 294:1606b061e4ce

examples: fix actions
author David Demelier <markand@malikania.fr>
date Wed, 10 Mar 2021 13:45:12 +0100
parents 5abf2ebb1621
children aec448037320
files examples/example-action/main.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/examples/example-action/main.c	Fri Mar 05 10:08:29 2021 +0100
+++ b/examples/example-action/main.c	Wed Mar 10 13:45:12 2021 +0100
@@ -291,9 +291,10 @@
 {
 	(void)act;
 
-	const int row = chest.opened ? 3 : 0;
+	const int row = chest.opened ? chest.sprite.nrows - 1 : 0;
+	const int col = chest.opened ? chest.sprite.ncols - 1 : 0;
 
-	sprite_draw(&chest.sprite, row, 0, chest.x, chest.y);
+	sprite_draw(&chest.sprite, row, col, chest.x, chest.y);
 }
 
 static void