A sophisticated Platformer Game Engine developed for the Game-Engine-Foundations course (CSC581) that demonstrates advanced computer science concepts through practical implementation. Features multiplayer networking, JavaScript scripting integration, and multiple deployment options.
This project showcases a complete game engine implementation featuring:
- Multi-Platform Support: Windows, macOS, Linux
- Real-time Multiplayer: Client-server architecture with ZeroMQ
- JavaScript Scripting: V8 engine integration for runtime scripting
- Advanced Graphics: SFML-based rendering with custom shapes
- Docker Containerization: Multiple deployment options
- Event System: Custom event handling with script callbacks
- Physics Engine: Collision detection and movement mechanics
- Object-Oriented Design: Inheritance, polymorphism, and encapsulation
- Custom Shapes: PentagonShape extending SFML's Shape class
- Physics Simulation: Collision detection, gravity, and movement
- Replay System: Record and playback game sessions
- Pause/Resume: Full game state management
- Variable Speed: 0.5x, 1x, 2x game speed options
- Client-Server Architecture: ZeroMQ-based messaging
- Real-time Synchronization: Character positions and game states
- Multiple Clients: Support for multiple simultaneous players
- Network Optimization: Efficient state management and updates
- V8 Engine Integration: Full JavaScript runtime support
- Hot Reloading: Live script updates during development
- Event Callbacks: Script-based event handling
- Native Integration: Seamless C++ to JavaScript communication
- Character movement and jumping
- Platform collision detection
- Color modification through scripts
- Physics-based movement
- Enemy spawning and movement patterns
- Bullet shooting system
- Collision detection for scoring
- Event-driven game mechanics
- Physics-based bird movement
- Obstacle generation and collision
- Score tracking system
- Boundary detection
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Game Client โ โ Game Server โ
โ (Docker) โโโโโบโ (Docker) โ
โ - SFML GUI โ โ - State Mgmt โ
โ - V8 Scripts โ โ - Networking โ
โ - Physics โ โ - Multiplayer โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โผ
Display Options:
- X11 Forwarding
- VNC Web Interface
- Headless Mode
- C++17 compiler (GCC/Clang)
- SFML 2.5+
- ZeroMQ
- V8 JavaScript Engine
- CMake (optional)
# Server
cd server
g++ -c game_server.cpp -lzmq
g++ game_server.o -o game_server -lsfml-graphics -lsfml-system -lsfml-window -lzmq -pthread
./game_server
# Client
make
./main- Native Build
- Install Visual Studio Build Tools
- Install vcpkg for dependencies
- Follow build instructions
- Native Build
- Install Xcode Command Line Tools
- Install dependencies via Homebrew
- Follow build instructions
- Native Build
sudo apt install build-essential libsfml-dev libzmq3-dev libv8-dev make
- A: Move Left
- D: Move Right
- Space: Jump/Shoot
- P: Pause/Unpause
- R: Record/Play Replay
- Q: Change Speed (0.5x, 1x, 2x)
- E: Resize (with title bar button)
- Space Invaders: Space to shoot bullets
- Flappy Bird: Space to flap wings
- Platformer: A/D for movement, Space to jump
- A + D (Chord): Triggers death script
- Movement: Triggers color modification script
- Collisions: Triggers event handling scripts
Game-Engine-main/
โโโ ๐ assets/ # Game assets (images, videos)
โโโ ๐ scripts/ # JavaScript game scripts
โโโ ๐ server/ # Game server implementation
โโโ ๐ Versions/ # Homework progression (HW1-HW5)
โโโ ๐ game.cpp # Main game engine (1199 lines)
โโโ ๐ ScriptManager.* # JavaScript integration
โโโ ๐ v8helpers.* # V8 JavaScript helpers
The engine supports JavaScript scripting through V8:
// Example: modify_color.js
function getRandomColor() {
return Math.floor(Math.random() * 0xFFFFFF);
}
print("Modifying GameObject Through Script");
platform.color = getRandomColor();- Create new game logic in
game.cpp - Add game-specific controls
- Implement collision detection
- Add JavaScript event handlers
- Update Docker configurations if needed
This project demonstrates progression through 5 major assignments:
- Basic C++ classes and inheritance
- SFML graphics integration
- Custom shape implementation
- ZeroMQ integration
- Client-server communication
- Real-time state synchronization
- Multiple client support
- Multiple server architecture
- JSON-based communication
- Enhanced state management
- Physics simulation
- Collision detection
- Game state management
- Replay system
- V8 JavaScript engine
- Script management system
- Event-driven programming
- Hot reloading
- SFML 2.5: Graphics, window management, input handling
- ZeroMQ: High-performance messaging library
- V8: JavaScript engine for scripting
- Docker: Containerization and deployment
- X11/VNC: Display forwarding for GUI
- Makefile: Cross-platform build configuration
- Docker: Multi-stage builds for optimization
- CMake: Alternative build system support
- Multi-threading: SFML Mutex for thread safety
- Memory Management: RAII and smart pointers
- Network Optimization: Efficient state updates
- Graphics: Hardware-accelerated rendering
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow C++17 standards
- Use meaningful variable names
- Add comments for complex logic
- Test on multiple platforms
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
Madhur Dixit - Game Engine Foundations Course (CSC581)
โ Completed - All features implemented and tested
- Display not found: Check DISPLAY environment variable
- Connection refused: Restart X11 server
- Permission denied: Run
xhost +local:docker
- Connection timeout: Check firewall settings
- Port not accessible: Verify port forwarding
- Server not responding: Check server logs
๐ฎ Enjoy your advanced game engine with multiplayer and scripting capabilities!


