Pixel Place Multiplay is a multiplayer web application where users can collaborate to create pixel art. This project demonstrates real-time updates and collaboration using modern web technologies.
Pixel Place Multiplay uses GUN, a decentralized database, to enable real-time data synchronization. GUN allows data to be distributed across multiple nodes, creating a peer-to-peer network. In this project, we connect to a GUN relay server hosted at https://gun-manhattan.herokuapp.com/gun
. This setup ensures that pixel updates are instantly synchronized across all connected users, providing a seamless collaborative experience. You can also set up and host your own GUN nodes if you prefer to manage your own data.
const gun = Gun(['https://gun-manhattan.herokuapp.com/gun']);
const pixelsRef = gun.get('websim-rplace-pixels-5');
const tilesPlacedRef = gun.get('websim-rplace-tiles-placed');
pixelsRef.map().on(function(data, key) {
if (data && !seenPixels.has(key)) {
const [x, y] = key.split(',').map(Number);
updatePixel(x, y, data.color);
tilesPlaced++;
document.getElementById('tiles-placed').textContent = tilesPlaced;
seenPixels.add(key);
}
});
Check out the live demo: Pixel Place Multiplay
- Real-time pixel art collaboration
- Interactive grid for pixel art creation
- Responsive design for various devices
- User-friendly interface
- Multiple color options for drawing
- HTML5
- CSS3
- JavaScript (ES6+)
- WebSockets for real-time communication
- Node.js (for server)
- Express.js (for server framework)
- GUN for decentralized real-time database
- Node.js (latest version recommended)
- npm (Node package manager)
- Web browser (latest version recommended)
- Clone the repository:
git clone https://github.com/joe-shenouda/pixel-place-multiplay.git
- Navigate to the project directory:
cd pixel-place-multiplay
- Install the dependencies:
npm install
- Start the server:
npm start
- Open
index.html
in your web browser.
- Open the application in your web browser.
- Use the interactive grid to draw pixel art.
- Collaborate with other users in real-time.
- Choose different colors from the palette to create your artwork.
Contributions are welcome! Follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Special thanks to all contributors and users for their support.
- Inspired by collaborative pixel art projects.
For any inquiries, please contact Joe Shenouda via GitHub.