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

Add feature: Show Ghost piece #33

Closed
wants to merge 6 commits into from

Conversation

jriyyya
Copy link
Contributor

@jriyyya jriyyya commented Jun 10, 2023

please review @chimosky @sourabhaa

jriyyya and others added 3 commits June 10, 2023 09:48
- This feature allows player to see where their piece is going to land

- Only py is calculated for ghost piece as px remains the same

- It is done through generate_ghost_py() which checks where
  the peice can be dropped, and return that py

- The color for the ghost pieces are generated by interpolating
  the original tile color and the background tile color through the
  function get_ghost_color()
Gdk.color_parse is deprecated in Gdk4.0 so we don't need to use
it anymore

Signed-off-by: Chihurumnaya Ibiam <ibiam@sugarlabs.org>
Signed-off-by: Chihurumnaya Ibiam <ibiam@sugarlabs.org>
@chimosky
Copy link
Member

chimosky commented Jun 11, 2023

Reviewed, added some commits. Please review.

Also noticed that the key up event isn't handle sometimes, moving the block to the left or right then trying it makes it work and I haven't taken a look but it's possible it also happens on master.

BlockParty.py Outdated Show resolved Hide resolved
@jriyyya
Copy link
Contributor Author

jriyyya commented Jun 11, 2023

Reviewed, and I have made the necessary changes for getting the color through gdk.rgba

- Now this functionality is replaced with a
  for loop and it copies the colors from the
  self.colors array which already contains
  parsed colors
BlockParty.py Outdated Show resolved Hide resolved
BlockParty.py Outdated Show resolved Hide resolved
@chimosky
Copy link
Member

Tested f89dd40, works as expected.

I'll wait for others to test and review.

@sourabhaa
Copy link
Contributor

reviewed and tested, working fine.

@chimosky
Copy link
Member

Great! Merged by hand, thanks!

@chimosky chimosky closed this Jun 14, 2023
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.

None yet

3 participants