From ac9c187740797c5f8105b052bc057d274edc4be1 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Sat, 23 Oct 2021 09:50:55 -0400 Subject: (mkosarek) Better reemerging --- themes/LeafParticleRender.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'themes/LeafParticleRender.h') diff --git a/themes/LeafParticleRender.h b/themes/LeafParticleRender.h index 9f5d5f4..28c9bc1 100644 --- a/themes/LeafParticleRender.h +++ b/themes/LeafParticleRender.h @@ -10,20 +10,26 @@ struct LeafParticleLoadData { int numLeaves = 48; }; +enum LeafParticleState { + OnTree, + Falling, + OnGround, + Remerging +}; + struct LeafParticleUpdateData { - bool canFall = false; + LeafParticleState state = LeafParticleState::Remerging; + Renderer2dVertex* vertexToFollow = NULL; Vector4 color = Vector4(1.f, 0.f, 0.f, 0.f); float32 scale = 1.f; - float32 timeFallingSeconds = 0.f; - bool isFalling = false; + float32 timeElapsedSeconds = 0.f; int32 fallChance = -1; Vector2 fallPosition; float32 fallVerticalVelocity; float32 fallHorizontalFrequency; - bool onGround = false; float32 resetTime = 0.f; Renderer2dVertex* vertexPtr = NULL; -- cgit v1.2.1