-
Notifications
You must be signed in to change notification settings - Fork 73
-
Notifications
You must be signed in to change notification settings - Fork 73
Iterating over SpriteSheet starts at index 1 and ends at index 0 #55
Comments
As soon as you call |
Thanks for coming back so quickly.
Kind regards, |
Thanks for the snippet. I'll investigate that tonight. |
@apahl Should be fixed. Would you please test the change? |
I'm sorry, but that has not changed the behaviour for me. |
That is strange. I've tested your code twice and got the same output and at very last I see the first frame.
and second run:
They are identical and prove that at the end of the run the first frame is shown (and not the second one as before). |
Just out of interest: What did you expect at the end of the run? The first frame or nothing, since the execution went through? Because the former should be and (as far as I can tell) is the case. |
I thought that at the end of the run the last frame would be displayed, which, in case of the explosion, is an empty image. |
We're getting closer. :) I could implement it that way, but currently the behaviour is expected, because mostly you want a running or moving animation with a continuous cycle. That is why the first frame is shown after a cycle is complete. But I think your behaviour and the current shouldn't exclude each other. I'll try to make it adjustable for both behaviours. |
Great! Thanks a lot for your efforts! |
@apahl Could you test again? |
Works perfectly now! Thanks a lot!! |
My pleasure. ;) |
Hi, thanks for providing this excellent game library for D.
It seems to me, that iterating over a SpriteSheet using slideTextureRect() as described in the tutorial for the explosion starts with the rectangle at index 1 and ends with index 0. This can be seen when using a large timeout
explosion.timeout = 1000;
andexplosion.numOfExecutions = 1;
.Kind regards,
Axel
The text was updated successfully, but these errors were encountered: