Skip to content

Conversation

@Ayush3941
Copy link

🚀 Pull Request: Refactor Rock Paper Scissors Kivy App for Clean Structure & Assets Support

📄 Description:

This PR refactors the existing Rock Paper Scissors (RPS) game made with Kivy to achieve the following:

✅ Key Improvements:

  • Renamed entrypoint to main.py for proper Kivy project structure.
  • Assets directory added (/assets) for storing images like rock.png, paper.png, scissors.png.
  • Fixed kv imports: Removed the broken #:import main.ImageButton line.
  • Proper transition fixed in Python (FadeTransition now used directly in main.py).
  • Updated buttons to use Image assets over emojis for cross-platform consistency.
  • UI now works both on Desktop and Mobile with Kivy.
  • JSON save system preserved for history, stats, and streaks.

🛠 Changes Summary:

  • Renamed main file to main.py.
  • Removed faulty #:import in .kv file.
  • Added fade transition properly via ScreenManager.
  • Added proper ImageButton behavior for assets.
  • Replaced emoji-based game choices with Image-based buttons for consistency.
  • Centralized save/load mechanism into the app root.
  • Fixed win/loss logic issues.
  • Responsive layout confirmed.

🐛 Issues Fixed:

  • ModuleNotFoundError: No module named 'main'
  • Missing assets on some platforms.
  • Broken transition and import issues in .kv file.
  • Mixed win/loss logic bugs.

✅ How to Test:

python main.py
  • Confirm rock/paper/scissors images work as buttons.
  • Confirm "History", "Leaderboard", "Reset Stats" work.
  • Confirm stats persist through restart.
  • Confirm app runs smoothly on both desktop and mobile resolutions.

🎉 Final Outcome:

Fully functioning, cleanly structured, cross-platform compatible Rock Paper Scissors app using Kivy.

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.

1 participant