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

Refactoring to simplify logic/enhance flexibility #15

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

univeous
Copy link
Contributor

@univeous univeous commented Dec 6, 2024

Description

I think some parts of the current implementation are overly complex while not being flexible enough.

I made the following changes:

  • Deprecate SequenceAction (I think they are not flexible enough)
  • Deprecate Piece types (again, I don't think they're flexible enough; I think along with the following changes, just shape would suffice)
  • Pieces can determine whether to match with other pieces
  • Pieces can customize their behavior when consumed

Existing issues:

  • I haven't got the SpecialShapeConsumerPiece in the demo to work yet
  • Possible unexpected consumption behavior (when there are a large number of SpecialCrossPiece)
  • SpecialCrossPiece may sometimes be consumed twice

I plan to make some fixes, but I can't promise.

Done!

Addressed issues

@univeous
Copy link
Contributor Author

univeous commented Dec 11, 2024

I’ve fixed SpecialShapeConsumerPiece.
In fact, I now think that SequenceAction is indeed necessary. Otherwise, when two SpecialCrossPiece pieces swap and triggers, the animation for the elimination of the pieces only happens after both SpecialCrossPiece animations have finished playing, which feels unnatural. Perhaps we still need some form of Action, but not as many varieties.

@univeous
Copy link
Contributor Author

univeous commented Dec 11, 2024

Alright, I managed to get it working, but it might not be very intuitive. There might be a better way to approach this.

The only issue now is that sometimes I don’t know why the newly created SpecialCrossPiece gets triggered automatically. This seems to only happen in the consume phase after the fill phase. I’m not really sure what’s causing it.

u.mp4

(Automatically triggered at ~13s)

Edit
I found it

@univeous
Copy link
Contributor Author

I believe I've fixed all the bugs I know of. There's nothing more I can do on my end.

@ninetailsrabbit What are your thoughts?

@ninetailsrabbit
Copy link
Owner

I believe I've fixed all the bugs I know of. There's nothing more I can do on my end.

@ninetailsrabbit What are your thoughts?

Hi @univeous, there are too many changes, I have seen them at a glance and I would need a moment of concentration to go through it all in detail.

Even so, I appreciate your time, if you see that it works for you, keep at it. I think I will leave this repository a bit parked and I will focus on looking for a programming job since the needs of the real world are more important to me at the moment.

@univeous
Copy link
Contributor Author

Of course, no problem! Please proceed at your own pace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants