Skip to content

AquaCheese/py-learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Code Factory ๐Ÿญ

Learn Python Through Industrial Automation

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.

Code Factory Screenshot

๐ŸŽฏ Educational Objectives

Core Programming Concepts Covered:

  • 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

Computer Science Keywords Integrated:

  • 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

๐Ÿš€ Getting Started

Prerequisites

  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • No additional software installation required
  • Works on desktop, tablet, and mobile devices

Quick Start

  1. Clone or download this repository
  2. Open index.html in your web browser
  3. Complete the interactive tutorial
  4. Start programming your factory!

Local Development

# 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

๐ŸŽฎ How to Play

1. Understanding the Interface

  • 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

2. Writing Your First Program

# 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)

3. Built-in Functions

  • move_to(target) - Move to specific location
  • collect() - Collect resources
  • move_up(steps) - Move up on grid
  • move_down(steps) - Move down on grid
  • move_left(steps) - Move left on grid
  • move_right(steps) - Move right on grid
  • do_a_flip() - Fun bonus function!
  • print(message) - Display output

4. Progression System

  • 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

๐Ÿ—๏ธ Game Features

Progressive Learning

  • 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

Interactive Help System

  • Comprehensive function documentation
  • Programming concept explanations
  • Real-world applications and examples
  • Context-sensitive tips and suggestions

Gamification Elements

  • Points and achievement system
  • Resource management
  • Building and upgrade unlocks
  • Visual progress tracking

Accessibility Features

  • Keyboard shortcuts (Ctrl+Enter to run, F1 for help)
  • Auto-save functionality
  • Responsive design for all devices
  • Clear visual feedback and animations

๐Ÿ› ๏ธ Technical Architecture

Technologies Used

  • Frontend: HTML5, CSS3, JavaScript (ES6+)
  • Styling: CSS Grid, Flexbox, Custom Animations
  • Fonts: Google Fonts (Orbitron, Source Code Pro)
  • Storage: LocalStorage for progress saving

File Structure

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

Key Components

Game Engine (game-engine.js)

  • Manages game state and progression
  • Handles resource management
  • Controls objective completion
  • Manages unit positioning and actions

Code Interpreter (code-interpreter.js)

  • Parses Python-like syntax
  • Executes code safely in browser
  • Tracks programming concepts used
  • Provides error handling and feedback

Help System (help-system.js)

  • Educational content management
  • Interactive tutorials
  • Contextual help and suggestions
  • Progress-based content unlocking

๐ŸŽ“ Educational Alignment

Curriculum Standards

This game aligns with:

  • Computing/Computer Science curricula for ages 11-16
  • STEM education objectives
  • 21st-century skills development
  • Problem-solving and computational thinking

Learning Outcomes

Students will be able to:

  1. Write basic Python programs
  2. Understand fundamental programming concepts
  3. Apply computational thinking to problem-solving
  4. Recognize real-world applications of programming
  5. Debug and improve their code
  6. Collaborate and share programming solutions

Assessment Opportunities

  • Code portfolio development
  • Problem-solving process documentation
  • Peer code review activities
  • Creative automation challenges
  • Reflection on learning journey

๐Ÿšง Development Roadmap

Phase 1: Core Features โœ…

  • Basic game engine and UI
  • Python code interpreter
  • Tutorial system
  • Progressive unlocking
  • Help documentation

Phase 2: Enhanced Learning

  • Advanced Python concepts (classes, modules)
  • Code challenges and puzzles
  • Multiplayer collaboration features
  • Teacher dashboard and analytics
  • Student progress tracking

Phase 3: Extended Content

  • Additional programming languages
  • Real-world industrial scenarios
  • IoT and sensor integration concepts
  • AI and machine learning basics
  • Cybersecurity challenges

Phase 4: Platform Integration

  • LMS integration (Canvas, Moodle)
  • Google Classroom compatibility
  • Mobile app development
  • Offline mode capability

๐Ÿค Contributing

We welcome contributions from educators, developers, and students!

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Areas for Contribution

  • 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

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • 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

๐Ÿ“ž Support & Contact

๐Ÿ“Š Analytics & Privacy

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.

About

A game to teach Python!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published