Welcome contributors
Thank you for your interest in contributing to this classic Pacman clone! This project is built in C using SDL 1.2 and includes advanced features like resolution restoration with xrandr on Linux systems.Setting up your development environment
Install required dependencies
On Debian/Ubuntu systems, install all necessary libraries:
x11-utils provides xrandr, which is required for resolution restoration features.Build the project
The project uses a traditional Makefile:This will compile all source files in
src/ and generate the pacman executable.Project structure
Code style and conventions
Based on the existing codebase, please follow these conventions:Naming conventions
-
Variables: Use snake_case for variables and functions
-
Constants: Use UPPER_CASE for preprocessor definitions
-
Structs: Use lowercase names
Formatting
- Indentation: Use 2 spaces (not tabs)
-
Braces: Opening brace on same line for functions
- Line length: No strict limit, but keep it readable (typically under 100 characters)
Comments
- Use Spanish or English for comments (the codebase contains both)
- Add comments for complex logic, especially AI algorithms
- Document any xrandr or resolution-specific code
Error handling
- Always check return values from SDL functions
- Print error messages to stderr with descriptive context
Areas for contribution
Here are some ways you can contribute to the project:Features
Features
- Additional game modes (time trial, survival)
- High score persistence (save to file)
- Sound effects and music (using libmikmod)
- Power-up variations
- Additional levels with different layouts
- Gamepad/joystick support
Bug fixes
Bug fixes
- Resolution restoration issues on specific hardware
- Multi-monitor edge cases
- Memory leaks or segmentation faults
- Timing issues on different refresh rates
- Ghost AI pathfinding improvements
Performance
Performance
- Optimize sprite rendering (see
gfx.c:142) - Reduce CPU usage in game loop
- Improve memory management
- Profile and optimize hot paths
Platform support
Platform support
- macOS support (replace xrandr with native APIs)
- BSD compatibility
- Wayland support (alternative to X11/xrandr)
- Windows port (using different resolution APIs)
Documentation
Documentation
- Code documentation and comments
- Algorithm explanations (ghost AI)
- Architecture diagrams
- Gameplay guides
- Translation of Spanish comments to English
Code quality
Code quality
- Add function documentation
- Refactor long functions (see
misc.c:506- 916 lines) - Improve error handling
- Add input validation
- Remove unused code (see commented sections)
Pull request process
Create a feature branch
feature/for new featuresfix/for bug fixesdocs/for documentationrefactor/for code improvements
Make your changes
- Follow the code style conventions above
- Test thoroughly in both windowed and fullscreen modes
- Test with single and multiple monitors if changing resolution code
- Keep commits focused and atomic
Commit your changes
Write clear commit messages:Good commit message format:
- Start with a verb (Add, Fix, Update, Refactor)
- Be concise but descriptive
- Reference issue numbers if applicable
Building and cleaning
The
.gitignore is configured to exclude *.o, *~, and the pacman executable. Never commit these files.Getting help
If you have questions or need help:- Review existing code in
src/for examples - Check the README.md for project overview
- Open an issue for discussion before major changes
- Reference SDL 1.2 documentation for graphics-related questions
Code of conduct
This project is for educational and personal use. Be respectful, constructive, and collaborative in all interactions.Developed by amr using Debian Testing and classic C programming tools. Contributions are welcome to keep this project alive and improve it for the community!