search
HomeBackend DevelopmentPython TutorialBuilding an educational game with AI tools and Azure Static Web Apps (Part 1)

Ever wondered how games can revolutionize learning? I was captivated by the idea of merging creativity, technology, and fun, leading me to develop an educational visual novel game. Despite lacking game development experience, I embarked on this journey using Ren'Py, a Python-based visual novel engine. Leveraging AI tools for accelerated development and Azure Static Web Apps for deployment, I built a prototype teaching GitHub Copilot's coding assistance. A festive December theme added an extra layer of enjoyment.

This post details my approach:

  • Game creation with the Ren'Py framework.
  • AI tool usage (GitHub Copilot, Azure OpenAI Service) for faster development and visual asset generation.
  • Automated build and deployment via GitHub Actions and Azure Static Web Apps.

Intrigued? Play the game online and access the source code on my GitHub repository (link omitted for brevity).

The Genesis

Numerous educational games exist for cloud technologies, catering to all skill levels. Microsoft's Microsoft Technical Quest (a card game using Azure services) and similar AWS offerings exemplify gamified cloud learning.

Inspired by Microsoft Cloud Advocates' "Azure Space Mystery" (a text-based game with visuals and interactive questions), I aimed to create a similar experience, teaching a technical concept through a text-based game with quizzes and achievement rewards. GitHub Copilot's recent popularity made it my central theme, complemented by a festive December setting.

The result: Christmas Copilot Quest, a game guiding players through GitHub Copilot usage in Visual Studio Code, with GingerBot (Santa's Copilot-powered assistant) providing interactive guidance.

Building an educational game with AI tools and Azure Static Web Apps (Part 1)

Game screenshots: Main menu, dialogue example, learning resources page.

Crafting a Text-Based Game

Tech Stack:

My requirements included non-linear storytelling with quizzes impacting game flow, UI customization, custom component flexibility, and web app deployment. Python's familiarity led me to Ren'Py, fulfilling all needs with its scripting language for story, quizzes, and UI customization. Its Python extensibility and web export capabilities, along with its CLI for automated builds and deployments, were key factors.

Game Structure:

The game comprises three main components:

Script: The narrative (monologues/dialogues) and quizzes, organized into labeled sections.

Building an educational game with AI tools and Azure Static Web Apps (Part 1)

Game screenshots: Dialogue example, player quiz.

Graphical User Interface (GUI): Screens, menus, and visual elements. Ren'Py allowed both built-in screen customization (buttons, menus) and new screen creation (achievement notifications, resource menus).

Building an educational game with AI tools and Azure Static Web Apps (Part 1)

Custom game screens: Character selection, achievement notification, achievements screen.

Custom Python Code: Adds game-specific functionality (achievement system, character definitions, GUI utilities). These components were kept separate for maintainability. For example, a Python function determining player names is called directly from the script:

label introduction:
    felix "Ah, you must be the new coder Santa called for! What's your name?"

    $ player_input = renpy.input(
        _("(Type your name and press Enter, or press Enter to use the default name, [character_name].)")
    )
    $ player_name = character_utils.determine_player_name(player_input)

    player "I'm [player_name]."

AI Integration in Development

GitHub Copilot: Crucial for navigating Ren'Py. While Ren'Py's limited data might affect accuracy, Copilot largely helped understand Ren'Py components, such as suggesting a character selection screen with image buttons.

Building an educational game with AI tools and Azure Static Web Apps (Part 1)

GitHub Copilot's character selection screen suggestion.

AI Image Generation: To quickly create visuals, I used AI tools. DALL-E 3 (Azure OpenAI Service) initially provided decent images, but maintaining consistent style proved challenging. Microsoft Designer offered better consistency, particularly its avatar text-to-image feature. A "low poly" aesthetic ensured consistency and matched the game's style. Example prompt:

"Low-poly 3D portrait of a stylized woman with brown hair, wearing a blouse in christmas colors, featuring clean geometric shapes, flat colors, and soft lighting, in a minimalist futuristic style with white background."

Generated images were processed using filters for noise reduction, color smoothing, background removal, and polygon edge highlighting. Image combinations and duplicates created eye-blinking effects.

Conclusion and Next Steps

This post demonstrated Ren'Py and AI tools (GitHub Copilot, Azure OpenAI Service, Microsoft Designer) in creating an educational game prototype. The next step is deployment, leveraging Ren'Py's CLI and Azure Static Web Apps' GitHub Actions integration. The following resources offer further information on GitHub Copilot and DALL-E 3. (Links omitted for brevity).

The above is the detailed content of Building an educational game with AI tools and Azure Static Web Apps (Part 1). For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are some common reasons why a Python script might not execute on Unix?What are some common reasons why a Python script might not execute on Unix?Apr 28, 2025 am 12:18 AM

The reasons why Python scripts cannot run on Unix systems include: 1) Insufficient permissions, using chmod xyour_script.py to grant execution permissions; 2) Shebang line is incorrect or missing, you should use #!/usr/bin/envpython; 3) The environment variables are not set properly, and you can print os.environ debugging; 4) Using the wrong Python version, you can specify the version on the Shebang line or the command line; 5) Dependency problems, using virtual environment to isolate dependencies; 6) Syntax errors, using python-mpy_compileyour_script.py to detect.

Give an example of a scenario where using a Python array would be more appropriate than using a list.Give an example of a scenario where using a Python array would be more appropriate than using a list.Apr 28, 2025 am 12:15 AM

Using Python arrays is more suitable for processing large amounts of numerical data than lists. 1) Arrays save more memory, 2) Arrays are faster to operate by numerical values, 3) Arrays force type consistency, 4) Arrays are compatible with C arrays, but are not as flexible and convenient as lists.

What are the performance implications of using lists versus arrays in Python?What are the performance implications of using lists versus arrays in Python?Apr 28, 2025 am 12:10 AM

Listsare Better ForeflexibilityandMixdatatatypes, Whilearraysares Superior Sumerical Computation Sand Larged Datasets.1) Unselable List Xibility, MixedDatatypes, andfrequent elementchanges.2) Usarray's sensory -sensical operations, Largedatasets, AndwhenMemoryEfficiency

How does NumPy handle memory management for large arrays?How does NumPy handle memory management for large arrays?Apr 28, 2025 am 12:07 AM

NumPymanagesmemoryforlargearraysefficientlyusingviews,copies,andmemory-mappedfiles.1)Viewsallowslicingwithoutcopying,directlymodifyingtheoriginalarray.2)Copiescanbecreatedwiththecopy()methodforpreservingdata.3)Memory-mappedfileshandlemassivedatasetsb

Which requires importing a module: lists or arrays?Which requires importing a module: lists or arrays?Apr 28, 2025 am 12:06 AM

ListsinPythondonotrequireimportingamodule,whilearraysfromthearraymoduledoneedanimport.1)Listsarebuilt-in,versatile,andcanholdmixeddatatypes.2)Arraysaremorememory-efficientfornumericdatabutlessflexible,requiringallelementstobeofthesametype.

What data types can be stored in a Python array?What data types can be stored in a Python array?Apr 27, 2025 am 12:11 AM

Pythonlistscanstoreanydatatype,arraymodulearraysstoreonetype,andNumPyarraysarefornumericalcomputations.1)Listsareversatilebutlessmemory-efficient.2)Arraymodulearraysarememory-efficientforhomogeneousdata.3)NumPyarraysareoptimizedforperformanceinscient

What happens if you try to store a value of the wrong data type in a Python array?What happens if you try to store a value of the wrong data type in a Python array?Apr 27, 2025 am 12:10 AM

WhenyouattempttostoreavalueofthewrongdatatypeinaPythonarray,you'llencounteraTypeError.Thisisduetothearraymodule'sstricttypeenforcement,whichrequiresallelementstobeofthesametypeasspecifiedbythetypecode.Forperformancereasons,arraysaremoreefficientthanl

Which is part of the Python standard library: lists or arrays?Which is part of the Python standard library: lists or arrays?Apr 27, 2025 am 12:03 AM

Pythonlistsarepartofthestandardlibrary,whilearraysarenot.Listsarebuilt-in,versatile,andusedforstoringcollections,whereasarraysareprovidedbythearraymoduleandlesscommonlyusedduetolimitedfunctionality.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor