Code Factory is an educational game designed to teach Python programming to students aged 12-17 (Years 7-11) through the engaging theme of industrial automation. Players write Python code to control cranes, robots, and factory equipment while learning fundamental programming concepts.
- Variables - Store and manipulate data
- Functions - Create reusable code blocks
- Loops - Automate repetitive tasks
- Conditionals - Make decisions in code
- Algorithms - Step-by-step problem solving
- Debugging - Find and fix code errors
- Abstraction
- Artificial Intelligence
- Binary System
- Boolean Logic
- Computational Thinking
- Computer Hardware/Software
- Cyber Security
- Data Representation
- Digital Ethics
- Environmental Impact
- Networks & Internet
- Operating Systems
- Programming Paradigms
- User Interface Design
- Modern web browser (Chrome, Firefox, Safari, Edge)
- No additional software installation required
- Works on desktop, tablet, and mobile devices
- Clone or download this repository
- Open
index.htmlin your web browser - Complete the interactive tutorial
- Start programming your factory!
# Clone the repository
git clone https://github.com/yourusername/code-factory.git
cd code-factory
# Serve locally (optional)
python -m http.server 8000
# or
npx serve
# Open http://localhost:8000 in your browser- Factory Floor: Where your automated machines operate
- IDE Panel: Write Python code to control your machines
- Progress Panel: Track objectives and unlocks
- Resources Bar: Monitor energy, materials, data, and credits
# Move crane to materials source
move_to(materials_source)
# Collect materials
collect()
# Use loops for efficiency
for i in range(5):
collect()
print("Collected material", i+1)move_to(target)- Move to specific locationcollect()- Collect resourcesmove_up(steps)- Move up on gridmove_down(steps)- Move down on gridmove_left(steps)- Move left on gridmove_right(steps)- Move right on griddo_a_flip()- Fun bonus function!print(message)- Display output
- Complete objectives to earn energy and unlock features
- Level up to access new buildings and functions
- Unlock advanced programming concepts gradually
- Build increasingly complex automated systems
- Level 1: Basic movement and resource collection
- Level 2: Loops and automation
- Level 3: Functions and complex logic
- Level 4: Advanced building and sorting systems
- Comprehensive function documentation
- Programming concept explanations
- Real-world applications and examples
- Context-sensitive tips and suggestions
- Points and achievement system
- Resource management
- Building and upgrade unlocks
- Visual progress tracking
- Keyboard shortcuts (Ctrl+Enter to run, F1 for help)
- Auto-save functionality
- Responsive design for all devices
- Clear visual feedback and animations
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- Styling: CSS Grid, Flexbox, Custom Animations
- Fonts: Google Fonts (Orbitron, Source Code Pro)
- Storage: LocalStorage for progress saving
code-factory/
โโโ index.html # Main game interface
โโโ styles.css # All styling and animations
โโโ game-engine.js # Core game logic and state
โโโ code-interpreter.js # Python code parsing and execution
โโโ help-system.js # Educational content and tutorials
โโโ main.js # Application initialization and coordination
โโโ README.md # This documentation
- Manages game state and progression
- Handles resource management
- Controls objective completion
- Manages unit positioning and actions
- Parses Python-like syntax
- Executes code safely in browser
- Tracks programming concepts used
- Provides error handling and feedback
- Educational content management
- Interactive tutorials
- Contextual help and suggestions
- Progress-based content unlocking
This game aligns with:
- Computing/Computer Science curricula for ages 11-16
- STEM education objectives
- 21st-century skills development
- Problem-solving and computational thinking
Students will be able to:
- Write basic Python programs
- Understand fundamental programming concepts
- Apply computational thinking to problem-solving
- Recognize real-world applications of programming
- Debug and improve their code
- Collaborate and share programming solutions
- Code portfolio development
- Problem-solving process documentation
- Peer code review activities
- Creative automation challenges
- Reflection on learning journey
- Basic game engine and UI
- Python code interpreter
- Tutorial system
- Progressive unlocking
- Help documentation
- Advanced Python concepts (classes, modules)
- Code challenges and puzzles
- Multiplayer collaboration features
- Teacher dashboard and analytics
- Student progress tracking
- Additional programming languages
- Real-world industrial scenarios
- IoT and sensor integration concepts
- AI and machine learning basics
- Cybersecurity challenges
- LMS integration (Canvas, Moodle)
- Google Classroom compatibility
- Mobile app development
- Offline mode capability
We welcome contributions from educators, developers, and students!
- 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
- Educational Content: New tutorials, challenges, explanations
- Code Quality: Bug fixes, performance improvements
- Accessibility: Better support for diverse learners
- Localization: Translations for global accessibility
- Testing: Automated tests and quality assurance
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by "The Farmer Was Replaced" game mechanics
- Built for educational use in schools and coding clubs
- Thanks to the open-source community for tools and inspiration
- Special thanks to educators who provide feedback and testing
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: codefactory@example.com
- Twitter: @CodeFactoryGame
Code Factory respects student privacy:
- No personal data collection
- All progress stored locally
- Optional anonymous usage analytics
- COPPA and GDPR compliant
- Safe for classroom use
Happy coding! ๐ Build the future, one line of code at a time.