Skip to content

feature: added swipe and on-screen controls for 2048 game(#413)#452

Merged
steam-bell-92 merged 1 commit into
steam-bell-92:mainfrom
siri-004:feature/2048-game-swipe-controls
May 19, 2026
Merged

feature: added swipe and on-screen controls for 2048 game(#413)#452
steam-bell-92 merged 1 commit into
steam-bell-92:mainfrom
siri-004:feature/2048-game-swipe-controls

Conversation

@siri-004
Copy link
Copy Markdown
Contributor

📝 Description

This PR enhances the 2048 game by adding multiple control options for a better and more interactive user experience.

✨ Changes Made

  • Added swipe gesture support (mobile + touchpads)
  • Added on-screen directional control buttons
  • Improved keyboard arrow key handling
  • Ensured smooth game state updates after every move
  • Improved responsiveness for mobile layout
  • Fixed input handling conflicts between multiple control methods

🎮 Improvements

  • Users can now play using:
    • ⌨️ Keyboard arrows
    • 👆 Swipe gestures
    • 🔘 On-screen buttons

🧠 Technical Notes

  • Centralized movement logic using makeMove(direction)
  • Unified input handling for touch, mouse, and keyboard
  • Prevented accidental small swipe triggers using threshold check
image

🔗 Linked Issue

Closes #413


📋 Contribution Checklist

  • My code strictly adheres to the project guidelines (Standard library only, procedural code, clean spacing).
  • I have verified that my files are placed in the correct directory.
  • I have tested my changes thoroughly on my local machine.
  • I have included interactive emojis and clean console/UI outputs.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@siri-004 is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Owner

@steam-bell-92 steam-bell-92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Satisfying PR I must say

@steam-bell-92 steam-bell-92 merged commit 8bb8f93 into steam-bell-92:main May 19, 2026
3 of 4 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.

We appreciate the time and effort you put into improving this project. Contributions like yours help the repository grow and stay useful for everyone.

If you'd like to contribute again, please check the open issues and make sure you are assigned before opening another Pull Request.

Thanks again for your support! 🙌

@siri-004
Copy link
Copy Markdown
Contributor Author

@steam-bell-92 Thank you, glad you found it satisfying 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💡 [Feature]: Add Swipe and On-Screen Controls for 2048 Game🎮

2 participants