<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ravi kumar</title>
    <description>The latest articles on DEV Community by Ravi kumar (@ravikumar21).</description>
    <link>https://dev.to/ravikumar21</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3213704%2F993d8e5f-9a80-40c6-a7a8-c0e50ac259dc.png</url>
      <title>DEV Community: Ravi kumar</title>
      <link>https://dev.to/ravikumar21</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ravikumar21"/>
    <language>en</language>
    <item>
      <title>The container glows on mouse movement using CSS.</title>
      <dc:creator>Ravi kumar</dc:creator>
      <pubDate>Tue, 29 Jul 2025 12:31:00 +0000</pubDate>
      <link>https://dev.to/ravikumar21/the-container-glows-on-mouse-movement-using-css-ifa</link>
      <guid>https://dev.to/ravikumar21/the-container-glows-on-mouse-movement-using-css-ifa</guid>
      <description>&lt;p&gt;Check out this Pen I made!&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Ravi-Choudhary-the-reactor/embed/QwjGagO?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
    </item>
    <item>
      <title>storytells table</title>
      <dc:creator>Ravi kumar</dc:creator>
      <pubDate>Fri, 27 Jun 2025 09:02:53 +0000</pubDate>
      <link>https://dev.to/ravikumar21/storytells-table-2k57</link>
      <guid>https://dev.to/ravikumar21/storytells-table-2k57</guid>
      <description>&lt;p&gt;It's made I have only knowledge about HTML I was generate CSS and JAVASCRIPT by using Chatgpt. So it was made by help of AI.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/Ravi-Choudhary-the-reactor/embed/wBvWdqO?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Building “Alien RPG”: How I Used Amazon Q AI to Create an Alien RPG Game</title>
      <dc:creator>Ravi kumar</dc:creator>
      <pubDate>Wed, 28 May 2025 15:25:27 +0000</pubDate>
      <link>https://dev.to/ravikumar21/building-alien-rpg-how-i-used-amazon-q-ai-to-create-an-alien-rpg-game-52mo</link>
      <guid>https://dev.to/ravikumar21/building-alien-rpg-how-i-used-amazon-q-ai-to-create-an-alien-rpg-game-52mo</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzovo17kbvs2fqh13h4x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzovo17kbvs2fqh13h4x.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a student with limited resources and only a Chromebook, I want to create a game. However, many people suggest I need higher processing power and more advanced technology. One day, I watched a YouTube video about B.Tecky. I learned that Amazon's Q technology is incredibly powerful. With just one prompt, I was able to generate a game, and it was both efficient and impressive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro:
&lt;/h2&gt;

&lt;p&gt;Video games are getting AI at the heart of this evolution. I set out to create a game called "ALIEN RPG".I used Amazon Q, an advanced AI assistant by AWS, to speed up development and power the brains behind the game. In this game, we control this game by giving commands like type 1 enter, type 2 enter, and type 3 enter . We control this game with this command. It's like a Q and A gam e. Wee give you 3 options like Attack,  Use Item and Run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Amazon Q?&lt;/strong&gt;&lt;br&gt;
Amazon Q is a powerful AI tool designed by AWS to help developers build applications faster. Whether you’re writing code, generating assets, or managing logic, Amazon Q can assist with smart suggestions, code generation, and even integrations with your tools. For game developers, this opens up new ways to build dynamic and intelligent game systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alien RPG gameplay (How to play)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffx0ahqk4g3izx1vpkxs5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffx0ahqk4g3izx1vpkxs5.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the first screen of the game, When we start a game, it shows like that.&lt;br&gt;
First, we give a command 1 for &lt;strong&gt;New Game&lt;/strong&gt; and 2 for &lt;strong&gt;Quit&lt;/strong&gt;.&lt;br&gt;
When we type 1 and enter, they give the 2nd screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53u4az3dxqsafbln3q0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53u4az3dxqsafbln3q0u.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, enter your name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuj23y0c4jlfk5fdd1gr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuj23y0c4jlfk5fdd1gr.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;br&gt;
After entering the name, they give us 3rd screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fki41nnsb6xpv8f5sc1my.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fki41nnsb6xpv8f5sc1my.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, they give you three options when you go with 1st option and type 1 and enter they give fourth screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0v7f1kg9dr94tvomwqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0v7f1kg9dr94tvomwqj.png" alt=" " width="800" height="673"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to the game! You will attack and defend by choosing 1, 2, or 3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/q3Nt6tbVpp8?si=RZykqA-RlnKkFaCH" rel="noopener noreferrer"&gt;https://youtu.be/q3Nt6tbVpp8?si=RZykqA-RlnKkFaCH&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Prompting Strategy:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;build a game like a stone story they rpg fight eith aliens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conversation,code and chat of Amazon Q&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;build a game like a stone story they rpg fight eith aliens&lt;br&gt;
I'll help you build a text-based RPG game with alien combat, inspired by Stone Story RPG's ASCII art style. Let's &lt;/p&gt;

&lt;p&gt;create a simple game in Python that features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ASCII art for visuals&lt;/li&gt;
&lt;li&gt;Turn-based combat with aliens&lt;/li&gt;
&lt;li&gt;Basic RPG elements like health, attack, and items
Let's start by creating the main game file:
🛠️  Using tool: fs_write
⋮ 
● Path: /home/arayachaudhar1309202/alien_rpg.py&lt;/li&gt;
&lt;li&gt;     1: #!/usr/bin/env python3&lt;/li&gt;
&lt;li&gt;     2: import random&lt;/li&gt;
&lt;li&gt;     3: import time&lt;/li&gt;
&lt;li&gt;     4: import os&lt;/li&gt;
&lt;li&gt;     5: &lt;/li&gt;
&lt;li&gt;     6: class Player:&lt;/li&gt;
&lt;li&gt;     7:     def &lt;strong&gt;init&lt;/strong&gt;(self, name):&lt;/li&gt;
&lt;li&gt;     8:         self.name = name&lt;/li&gt;
&lt;li&gt;     9:         self.health = 100&lt;/li&gt;
&lt;li&gt;    10:         self.max_health = 100&lt;/li&gt;
&lt;li&gt;    11:         self.attack = 15&lt;/li&gt;
&lt;li&gt;    12:         self.defense = 5&lt;/li&gt;
&lt;li&gt;    13:         self.inventory = ["Health Potion", "Energy Crystal"]&lt;/li&gt;
&lt;li&gt;    14:         self.level = 1&lt;/li&gt;
&lt;li&gt;    15:         self.exp = 0&lt;/li&gt;
&lt;li&gt;    16:         self.exp_to_level = 100&lt;/li&gt;
&lt;li&gt;    17: &lt;/li&gt;
&lt;li&gt;    18:     def take_damage(self, damage):&lt;/li&gt;
&lt;li&gt;    19:         actual_damage = max(1, damage - self.defense)&lt;/li&gt;
&lt;li&gt;    20:         self.health = max(0, self.health - actual_damage)&lt;/li&gt;
&lt;li&gt;    21:         return actual_damage&lt;/li&gt;
&lt;li&gt;    22:
&lt;/li&gt;
&lt;li&gt;    23:     def heal(self, amount):&lt;/li&gt;
&lt;li&gt;    24:         self.health = min(self.max_health, self.health + amount)&lt;/li&gt;
&lt;li&gt;    25:
&lt;/li&gt;
&lt;li&gt;    26:     def level_up(self):&lt;/li&gt;
&lt;li&gt;    27:         self.level += 1&lt;/li&gt;
&lt;li&gt;    28:         self.max_health += 20&lt;/li&gt;
&lt;li&gt;    29:         self.health = self.max_health&lt;/li&gt;
&lt;li&gt;    30:         self.attack += 5&lt;/li&gt;
&lt;li&gt;    31:         self.defense += 2&lt;/li&gt;
&lt;li&gt;    32:         self.exp_to_level = int(self.exp_to_level * 1.5)&lt;/li&gt;
&lt;li&gt;    33:         print(f"\n╔═════════════════════════════════╗")&lt;/li&gt;
&lt;li&gt;    34:         print(f"║ LEVEL UP! You are now level {self.level}! ║")&lt;/li&gt;
&lt;li&gt;    35:         print(f"╚═════════════════════════════════╝")&lt;/li&gt;
&lt;li&gt;    36:         print(f"Health: {self.max_health} | Attack: {self.attack} | Defense: {self.defense}")&lt;/li&gt;
&lt;li&gt;    37:         time.sleep(2)&lt;/li&gt;
&lt;li&gt;    38:
&lt;/li&gt;
&lt;li&gt;    39:     def gain_exp(self, amount):&lt;/li&gt;
&lt;li&gt;    40:         self.exp += amount&lt;/li&gt;
&lt;li&gt;    41:         print(f"Gained {amount} experience points!")&lt;/li&gt;
&lt;li&gt;    42:         if self.exp &amp;gt;= self.exp_to_level:&lt;/li&gt;
&lt;li&gt;    43:             self.level_up()&lt;/li&gt;
&lt;li&gt;    44: &lt;/li&gt;
&lt;li&gt;    45: class Alien:&lt;/li&gt;
&lt;li&gt;    46:     def &lt;strong&gt;init&lt;/strong&gt;(self, level):&lt;/li&gt;
&lt;li&gt;    47:         alien_types = [&lt;/li&gt;
&lt;li&gt;    48:             {"name": "Crawler", "health": 30, "attack": 10, "defense": 2, "exp": 20, &lt;/li&gt;
&lt;li&gt;    49:              "ascii": ["   &lt;em&gt;...&lt;/em&gt;   ", "  /     \  ", " | O   O | ", " |   V   | ", "  \&lt;em&gt;---&lt;/em&gt;/  ", "   |||||   "]},&lt;/li&gt;
&lt;li&gt;    50:             {"name": "Blaster", "health": 40, "attack": 15, "defense": 3, "exp": 35, &lt;/li&gt;
&lt;li&gt;    51:              "ascii": ["  .---.  ", " /     \ ", "| -   - |", "|   ^   |", " \&lt;em&gt;-&lt;/em&gt;-_/ ", "  |||||  "]},&lt;/li&gt;
&lt;li&gt;    52:             {"name": "Sentinel", "health": 60, "attack": 12, "defense": 8, "exp": 50, &lt;/li&gt;
&lt;li&gt;    53:              "ascii": ["   /|\   ", "  / | \  ", " /--|--\ ", "/   |   \", "    |    ", "   / \   "]}&lt;/li&gt;
&lt;li&gt;    54:         ]&lt;/li&gt;
&lt;li&gt;    55:
&lt;/li&gt;
&lt;li&gt;    56:         alien_type = random.choice(alien_types)&lt;/li&gt;
&lt;li&gt;    57:         self.name = alien_type["name"]&lt;/li&gt;
&lt;li&gt;    58:         self.health = alien_type["health"] + (level * 5)&lt;/li&gt;
&lt;li&gt;    59:         self.max_health = self.health&lt;/li&gt;
&lt;li&gt;    60:         self.attack = alien_type["attack"] + (level * 2)&lt;/li&gt;
&lt;li&gt;    61:         self.defense = alien_type["defense"] + level&lt;/li&gt;
&lt;li&gt;    62:         self.exp_reward = alien_type["exp"] + (level * 10)&lt;/li&gt;
&lt;li&gt;    63:         self.ascii = alien_type["ascii"]&lt;/li&gt;
&lt;li&gt;    64:
&lt;/li&gt;
&lt;li&gt;    65:     def take_damage(self, damage):&lt;/li&gt;
&lt;li&gt;    66:         actual_damage = max(1, damage - self.defense)&lt;/li&gt;
&lt;li&gt;    67:         self.health = max(0, self.health - actual_damage)&lt;/li&gt;
&lt;li&gt;    68:         return actual_damage&lt;/li&gt;
&lt;li&gt;    69: &lt;/li&gt;
&lt;li&gt;    70: def clear_screen():&lt;/li&gt;
&lt;li&gt;    71:     os.system('cls' if os.name == 'nt' else 'clear')&lt;/li&gt;
&lt;li&gt;    72: &lt;/li&gt;
&lt;li&gt;    73: def display_health_bar(current, maximum, length=20):&lt;/li&gt;
&lt;li&gt;    74:     filled_length = int(length * current / maximum)&lt;/li&gt;
&lt;li&gt;    75:     bar = '█' * filled_length + '░' * (length - filled_length)&lt;/li&gt;
&lt;li&gt;    76:     percentage = int(100 * current / maximum)&lt;/li&gt;
&lt;li&gt;    77:     return f"{bar} {current}/{maximum} ({percentage}%)"&lt;/li&gt;
&lt;li&gt;    78: &lt;/li&gt;
&lt;li&gt;    79: def display_battle(player, alien):&lt;/li&gt;
&lt;li&gt;    80:     clear_screen()&lt;/li&gt;
&lt;li&gt;    81:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;    82:     print(f"  {player.name} vs {alien.name}")&lt;/li&gt;
&lt;li&gt;    83:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;    84:
&lt;/li&gt;
&lt;li&gt;    85:     # Display alien ASCII art&lt;/li&gt;
&lt;li&gt;    86:     for line in alien.ascii:&lt;/li&gt;
&lt;li&gt;    87:         print(f"{' ' * 25}{line}")&lt;/li&gt;
&lt;li&gt;    88:
&lt;/li&gt;
&lt;li&gt;    89:     print("\n" + "─" * 60)&lt;/li&gt;
&lt;li&gt;    90:     print(f"Player: {player.name} (Level {player.level})")&lt;/li&gt;
&lt;li&gt;    91:     print(f"HP: {display_health_bar(player.health, player.max_health)}")&lt;/li&gt;
&lt;li&gt;    92:     print(f"Attack: {player.attack} | Defense: {player.defense}")&lt;/li&gt;
&lt;li&gt;    93:     print("─" * 60)&lt;/li&gt;
&lt;li&gt;    94:     print(f"Alien: {alien.name}")&lt;/li&gt;
&lt;li&gt;    95:     print(f"HP: {display_health_bar(alien.health, alien.max_health)}")&lt;/li&gt;
&lt;li&gt;    96:     print(f"Attack: {alien.attack} | Defense: {alien.defense}")&lt;/li&gt;
&lt;li&gt;    97:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;    98: &lt;/li&gt;
&lt;li&gt;    99: def player_turn(player, alien):&lt;/li&gt;
&lt;li&gt;   100:     print("\nYour turn! What would you like to do?")&lt;/li&gt;
&lt;li&gt;   101:     print("1. Attack")&lt;/li&gt;
&lt;li&gt;   102:     print("2. Use Item")&lt;/li&gt;
&lt;li&gt;   103:     print("3. Run Away")&lt;/li&gt;
&lt;li&gt;   104:
&lt;/li&gt;
&lt;li&gt;   105:     while True:&lt;/li&gt;
&lt;li&gt;   106:         choice = input("&amp;gt; ")&lt;/li&gt;
&lt;li&gt;   107:         if choice == "1":&lt;/li&gt;
&lt;li&gt;   108:             damage_dealt = alien.take_damage(player.attack)&lt;/li&gt;
&lt;li&gt;   109:             print(f"You attack the {alien.name} for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   110:             time.sleep(1)&lt;/li&gt;
&lt;li&gt;   111:             return True&lt;/li&gt;
&lt;li&gt;   112:         elif choice == "2":&lt;/li&gt;
&lt;li&gt;   113:             if not player.inventory:&lt;/li&gt;
&lt;li&gt;   114:                 print("Your inventory is empty!")&lt;/li&gt;
&lt;li&gt;   115:                 time.sleep(1)&lt;/li&gt;
&lt;li&gt;   116:                 continue&lt;/li&gt;
&lt;li&gt;   117:
&lt;/li&gt;
&lt;li&gt;   118:             print("\nInventory:")&lt;/li&gt;
&lt;li&gt;   119:             for i, item in enumerate(player.inventory, 1):&lt;/li&gt;
&lt;li&gt;   120:                 print(f"{i}. {item}")&lt;/li&gt;
&lt;li&gt;   121:             print("0. Back")&lt;/li&gt;
&lt;li&gt;   122:
&lt;/li&gt;
&lt;li&gt;   123:             item_choice = input("Select an item to use (or 0 to go back): ")&lt;/li&gt;
&lt;li&gt;   124:             if item_choice == "0":&lt;/li&gt;
&lt;li&gt;   125:                 continue&lt;/li&gt;
&lt;li&gt;   126:
&lt;/li&gt;
&lt;li&gt;   127:             try:&lt;/li&gt;
&lt;li&gt;   128:                 item_index = int(item_choice) - 1&lt;/li&gt;
&lt;li&gt;   129:                 if 0 &amp;lt;= item_index &amp;lt; len(player.inventory):&lt;/li&gt;
&lt;li&gt;   130:                     item = player.inventory.pop(item_index)&lt;/li&gt;
&lt;li&gt;   131:                     if item == "Health Potion":&lt;/li&gt;
&lt;li&gt;   132:                         heal_amount = 30&lt;/li&gt;
&lt;li&gt;   133:                         player.heal(heal_amount)&lt;/li&gt;
&lt;li&gt;   134:                         print(f"You used a Health Potion and recovered {heal_amount} health!")&lt;/li&gt;
&lt;li&gt;   135:                     elif item == "Energy Crystal":&lt;/li&gt;
&lt;li&gt;   136:                         damage_dealt = alien.take_damage(25)&lt;/li&gt;
&lt;li&gt;   137:                         print(f"You used an Energy Crystal! It blasts the {alien.name} for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   138:                     time.sleep(1)&lt;/li&gt;
&lt;li&gt;   139:                     return True&lt;/li&gt;
&lt;li&gt;   140:                 else:&lt;/li&gt;
&lt;li&gt;   141:                     print("Invalid item number!")&lt;/li&gt;
&lt;li&gt;   142:             except ValueError:&lt;/li&gt;
&lt;li&gt;   143:                 print("Please enter a number!")&lt;/li&gt;
&lt;li&gt;   144:         elif choice == "3":&lt;/li&gt;
&lt;li&gt;   145:             if random.random() &amp;lt; 0.5:&lt;/li&gt;
&lt;li&gt;   146:                 print("You managed to escape!")&lt;/li&gt;
&lt;li&gt;   147:                 time.sleep(1)&lt;/li&gt;
&lt;li&gt;   148:                 return False&lt;/li&gt;
&lt;li&gt;   149:             else:&lt;/li&gt;
&lt;li&gt;   150:                 print("You couldn't escape!")&lt;/li&gt;
&lt;li&gt;   151:                 time.sleep(1)&lt;/li&gt;
&lt;li&gt;   152:                 return True&lt;/li&gt;
&lt;li&gt;   153:         else:&lt;/li&gt;
&lt;li&gt;   154:             print("Invalid choice! Try again.")&lt;/li&gt;
&lt;li&gt;   155: &lt;/li&gt;
&lt;li&gt;   156: def alien_turn(player, alien):&lt;/li&gt;
&lt;li&gt;   157:     print(f"\nThe {alien.name}'s turn!")&lt;/li&gt;
&lt;li&gt;   158:     time.sleep(0.5)&lt;/li&gt;
&lt;li&gt;   159:
&lt;/li&gt;
&lt;li&gt;   160:     # Aliens have a chance to perform special moves&lt;/li&gt;
&lt;li&gt;   161:     move_type = random.choices(&lt;/li&gt;
&lt;li&gt;   162:         ["attack", "special"],&lt;/li&gt;
&lt;li&gt;   163:         weights=[0.7, 0.3],&lt;/li&gt;
&lt;li&gt;   164:         k=1&lt;/li&gt;
&lt;li&gt;   165:     )[0]&lt;/li&gt;
&lt;li&gt;   166:
&lt;/li&gt;
&lt;li&gt;   167:     if move_type == "attack":&lt;/li&gt;
&lt;li&gt;   168:         damage_dealt = player.take_damage(alien.attack)&lt;/li&gt;
&lt;li&gt;   169:         print(f"The {alien.name} attacks you for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   170:     else:&lt;/li&gt;
&lt;li&gt;   171:         if alien.name == "Crawler":&lt;/li&gt;
&lt;li&gt;   172:             damage_dealt = player.take_damage(int(alien.attack * 1.5))&lt;/li&gt;
&lt;li&gt;   173:             print(f"The {alien.name} uses Acid Spray for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   174:         elif alien.name == "Blaster":&lt;/li&gt;
&lt;li&gt;   175:             damage_dealt = player.take_damage(alien.attack * 2)&lt;/li&gt;
&lt;li&gt;   176:             print(f"The {alien.name} uses Energy Blast for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   177:         elif alien.name == "Sentinel":&lt;/li&gt;
&lt;li&gt;   178:             alien.health = min(alien.max_health, alien.health + 10)&lt;/li&gt;
&lt;li&gt;   179:             print(f"The {alien.name} uses Regeneration and recovers 10 health!")&lt;/li&gt;
&lt;li&gt;   180:
&lt;/li&gt;
&lt;li&gt;   181:     time.sleep(1)&lt;/li&gt;
&lt;li&gt;   182:     return True&lt;/li&gt;
&lt;li&gt;   183: &lt;/li&gt;
&lt;li&gt;   184: def battle(player, alien):&lt;/li&gt;
&lt;li&gt;   185:     battle_active = True&lt;/li&gt;
&lt;li&gt;   186:
&lt;/li&gt;
&lt;li&gt;   187:     while battle_active:&lt;/li&gt;
&lt;li&gt;   188:         display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   189:
&lt;/li&gt;
&lt;li&gt;   190:         # Player's turn&lt;/li&gt;
&lt;li&gt;   191:         battle_active = player_turn(player, alien)&lt;/li&gt;
&lt;li&gt;   192:         if not battle_active:&lt;/li&gt;
&lt;li&gt;   193:             return "escaped"&lt;/li&gt;
&lt;li&gt;   194:
&lt;/li&gt;
&lt;li&gt;   195:         # Check if alien is defeated&lt;/li&gt;
&lt;li&gt;   196:         if alien.health &amp;lt;= 0:&lt;/li&gt;
&lt;li&gt;   197:             display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   198:             print(f"\nYou defeated the {alien.name}!")&lt;/li&gt;
&lt;li&gt;   199:             player.gain_exp(alien.exp_reward)&lt;/li&gt;
&lt;li&gt;   200:
&lt;/li&gt;
&lt;li&gt;   201:             # Random loot&lt;/li&gt;
&lt;li&gt;   202:             if random.random() &amp;lt; 0.3:&lt;/li&gt;
&lt;li&gt;   203:                 loot = random.choice(["Health Potion", "Energy Crystal"])&lt;/li&gt;
&lt;li&gt;   204:                 player.inventory.append(loot)&lt;/li&gt;
&lt;li&gt;   205:                 print(f"You found a {loot}!")&lt;/li&gt;
&lt;li&gt;   206:
&lt;/li&gt;
&lt;li&gt;   207:             time.sleep(2)&lt;/li&gt;
&lt;li&gt;   208:             return "victory"&lt;/li&gt;
&lt;li&gt;   209:
&lt;/li&gt;
&lt;li&gt;   210:         # Alien's turn&lt;/li&gt;
&lt;li&gt;   211:         display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   212:         battle_active = alien_turn(player, alien)&lt;/li&gt;
&lt;li&gt;   213:
&lt;/li&gt;
&lt;li&gt;   214:         # Check if player is defeated&lt;/li&gt;
&lt;li&gt;   215:         if player.health &amp;lt;= 0:&lt;/li&gt;
&lt;li&gt;   216:             display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   217:             print("\nYou have been defeated!")&lt;/li&gt;
&lt;li&gt;   218:             time.sleep(2)&lt;/li&gt;
&lt;li&gt;   219:             return "defeat"&lt;/li&gt;
&lt;li&gt;   220:
&lt;/li&gt;
&lt;li&gt;   221:         time.sleep(1)&lt;/li&gt;
&lt;li&gt;   222: &lt;/li&gt;
&lt;li&gt;   223: def explore(player):&lt;/li&gt;
&lt;li&gt;   224:     clear_screen()&lt;/li&gt;
&lt;li&gt;   225:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   226:     print("You venture deeper into the alien territory...")&lt;/li&gt;
&lt;li&gt;   227:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;   228:
&lt;/li&gt;
&lt;li&gt;   229:     events = [&lt;/li&gt;
&lt;li&gt;   230:         {"type": "battle", "weight": 0.7},&lt;/li&gt;
&lt;li&gt;   231:         {"type": "item", "weight": 0.2},&lt;/li&gt;
&lt;li&gt;   232:         {"type": "rest", "weight": 0.1}&lt;/li&gt;
&lt;li&gt;   233:     ]&lt;/li&gt;
&lt;li&gt;   234:
&lt;/li&gt;
&lt;li&gt;   235:     event_types = [e["type"] for e in events]&lt;/li&gt;
&lt;li&gt;   236:     weights = [e["weight"] for e in events]&lt;/li&gt;
&lt;li&gt;   237:
&lt;/li&gt;
&lt;li&gt;   238:     event = random.choices(event_types, weights=weights, k=1)[0]&lt;/li&gt;
&lt;li&gt;   239:
&lt;/li&gt;
&lt;li&gt;   240:     if event == "battle":&lt;/li&gt;
&lt;li&gt;   241:         print("You encounter an alien!")&lt;/li&gt;
&lt;li&gt;   242:         time.sleep(1)&lt;/li&gt;
&lt;li&gt;   243:         alien = Alien(max(1, player.level - 1 + random.randint(0, 2)))&lt;/li&gt;
&lt;li&gt;   244:         result = battle(player, alien)&lt;/li&gt;
&lt;li&gt;   245:
&lt;/li&gt;
&lt;li&gt;   246:         if result == "defeat":&lt;/li&gt;
&lt;li&gt;   247:             return False&lt;/li&gt;
&lt;li&gt;   248:
&lt;/li&gt;
&lt;li&gt;   249:     elif event == "item":&lt;/li&gt;
&lt;li&gt;   250:         items = ["Health Potion", "Energy Crystal"]&lt;/li&gt;
&lt;li&gt;   251:         item = random.choice(items)&lt;/li&gt;
&lt;li&gt;   252:         player.inventory.append(item)&lt;/li&gt;
&lt;li&gt;   253:         print(f"You found a {item}!")&lt;/li&gt;
&lt;li&gt;   254:         time.sleep(2)&lt;/li&gt;
&lt;li&gt;   255:
&lt;/li&gt;
&lt;li&gt;   256:     elif event == "rest":&lt;/li&gt;
&lt;li&gt;   257:         heal_amount = player.max_health // 4&lt;/li&gt;
&lt;li&gt;   258:         player.heal(heal_amount)&lt;/li&gt;
&lt;li&gt;   259:         print(f"You found a safe spot to rest and recovered {heal_amount} health.")&lt;/li&gt;
&lt;li&gt;   260:         time.sleep(2)&lt;/li&gt;
&lt;li&gt;   261:
&lt;/li&gt;
&lt;li&gt;   262:     return True&lt;/li&gt;
&lt;li&gt;   263: &lt;/li&gt;
&lt;li&gt;   264: def main_menu():&lt;/li&gt;
&lt;li&gt;   265:     clear_screen()&lt;/li&gt;
&lt;li&gt;   266:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   267:     print("""&lt;/li&gt;
&lt;li&gt;   268:      █████╗ ██╗     ██╗███████╗███╗   ██╗    ██████╗ ██████╗  ██████╗ &lt;/li&gt;
&lt;li&gt;   269:     ██╔══██╗██║     ██║██╔════╝████╗  ██║    ██╔══██╗██╔══██╗██╔════╝ &lt;/li&gt;
&lt;li&gt;   270:     ███████║██║     ██║█████╗  ██╔██╗ ██║    ██████╔╝██████╔╝██║  ███╗&lt;/li&gt;
&lt;li&gt;   271:     ██╔══██║██║     ██║██╔══╝  ██║╚██╗██║    ██╔══██╗██╔═══╝ ██║   ██║&lt;/li&gt;
&lt;li&gt;   272:     ██║  ██║███████╗██║███████╗██║ ╚████║    ██║  ██║██║     ╚██████╔╝&lt;/li&gt;
&lt;li&gt;   273:     ╚═╝  ╚═╝╚══════╝╚═╝╚══════╝╚═╝  ╚═══╝    ╚═╝  ╚═╝╚═╝      ╚═════╝ &lt;/li&gt;
&lt;li&gt;   274:     """)&lt;/li&gt;
&lt;li&gt;   275:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;   276:     print("\n1. New Game")&lt;/li&gt;
&lt;li&gt;   277:     print("2. Quit")&lt;/li&gt;
&lt;li&gt;   278:
&lt;/li&gt;
&lt;li&gt;   279:     choice = input("\n&amp;gt; ")&lt;/li&gt;
&lt;li&gt;   280:     if choice == "1":&lt;/li&gt;
&lt;li&gt;   281:         return True&lt;/li&gt;
&lt;li&gt;   282:     else:&lt;/li&gt;
&lt;li&gt;   283:         return False&lt;/li&gt;
&lt;li&gt;   284: &lt;/li&gt;
&lt;li&gt;   285: def game_over(player):&lt;/li&gt;
&lt;li&gt;   286:     clear_screen()&lt;/li&gt;
&lt;li&gt;   287:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   288:     print("""&lt;/li&gt;
&lt;li&gt;   289:      ██████╗  █████╗ ███╗   ███╗███████╗     ██████╗ ██╗   ██╗███████╗██████╗ &lt;/li&gt;
&lt;li&gt;   290:     ██╔════╝ ██╔══██╗████╗ ████║██╔════╝    ██╔═══██╗██║   ██║██╔════╝██╔══██╗&lt;/li&gt;
&lt;li&gt;   291:     ██║  ███╗███████║██╔████╔██║█████╗      ██║   ██║██║   ██║█████╗  ██████╔╝&lt;/li&gt;
&lt;li&gt;   292:     ██║   ██║██╔══██║██║╚██╔╝██║██╔══╝      ██║   ██║╚██╗ ██╔╝██╔══╝  ██╔══██╗&lt;/li&gt;
&lt;li&gt;   293:     ╚██████╔╝██║  ██║██║ ╚═╝ ██║███████╗    ╚██████╔╝ ╚████╔╝ ███████╗██║  ██║&lt;/li&gt;
&lt;li&gt;   294:      ╚═════╝ ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝     ╚═════╝   ╚═══╝  ╚══════╝╚═╝  ╚═╝&lt;/li&gt;
&lt;li&gt;   295:     """)&lt;/li&gt;
&lt;li&gt;   296:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;   297:     print(f"\nYou were defeated at level {player.level}!")&lt;/li&gt;
&lt;li&gt;   298:     print(f"Experience points: {player.exp}")&lt;/li&gt;
&lt;li&gt;   299:     print(f"Items collected: {len(player.inventory)}")&lt;/li&gt;
&lt;li&gt;   300:
&lt;/li&gt;
&lt;li&gt;   301:     input("\nPress Enter to return to the main menu...")&lt;/li&gt;
&lt;li&gt;   302: &lt;/li&gt;
&lt;li&gt;   303: def game_loop():&lt;/li&gt;
&lt;li&gt;   304:     if not main_menu():&lt;/li&gt;
&lt;li&gt;   305:         return&lt;/li&gt;
&lt;li&gt;   306:
&lt;/li&gt;
&lt;li&gt;   307:     clear_screen()&lt;/li&gt;
&lt;li&gt;   308:     print("\nWelcome, brave warrior! Earth is under attack by alien forces.")&lt;/li&gt;
&lt;li&gt;   309:     print("You are humanity's last hope. Fight the aliens and save our planet!")&lt;/li&gt;
&lt;li&gt;   310:
&lt;/li&gt;
&lt;li&gt;   311:     player_name = input("\nEnter your name: ")&lt;/li&gt;
&lt;li&gt;   312:     player = Player(player_name)&lt;/li&gt;
&lt;li&gt;   313:
&lt;/li&gt;
&lt;li&gt;   314:     game_active = True&lt;/li&gt;
&lt;li&gt;   315:     while game_active:&lt;/li&gt;
&lt;li&gt;   316:         clear_screen()&lt;/li&gt;
&lt;li&gt;   317:         print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   318:         print(f"Name: {player.name} | Level: {player.level} | EXP: {player.exp}/{player.exp_to_level}")&lt;/li&gt;
&lt;li&gt;   319:         print(f"Health: {display_health_bar(player.health, player.max_health)}")&lt;/li&gt;
&lt;li&gt;   320:         print(f"Attack: {player.attack} | Defense: {player.defense}")&lt;/li&gt;
&lt;li&gt;   321:         print(f"Inventory: {', '.join(player.inventory) if player.inventory else 'Empty'}")&lt;/li&gt;
&lt;li&gt;   322:         print("═" * 60)&lt;/li&gt;
&lt;li&gt;   323:         print("\n1. Explore")&lt;/li&gt;
&lt;li&gt;   324:         print("2. Rest (Recover 30% HP)")&lt;/li&gt;
&lt;li&gt;   325:         print("3. Quit")&lt;/li&gt;
&lt;li&gt;   326:
&lt;/li&gt;
&lt;li&gt;   327:         choice = input("\n&amp;gt; ")&lt;/li&gt;
&lt;li&gt;   328:         if choice == "1":&lt;/li&gt;
&lt;li&gt;   329:             game_active = explore(player)&lt;/li&gt;
&lt;li&gt;   330:         elif choice == "2":&lt;/li&gt;
&lt;li&gt;   331:             heal_amount = int(player.max_health * 0.3)&lt;/li&gt;
&lt;li&gt;   332:             player.heal(heal_amount)&lt;/li&gt;
&lt;li&gt;   333:             print(f"You rest and recover {heal_amount} health.")&lt;/li&gt;
&lt;li&gt;   334:             time.sleep(2)&lt;/li&gt;
&lt;li&gt;   335:         elif choice == "3":&lt;/li&gt;
&lt;li&gt;   336:             break&lt;/li&gt;
&lt;li&gt;   337:         else:&lt;/li&gt;
&lt;li&gt;   338:             print("Invalid choice!")&lt;/li&gt;
&lt;li&gt;   339:             time.sleep(1)&lt;/li&gt;
&lt;li&gt;   340:
&lt;/li&gt;
&lt;li&gt;   341:     if not game_active:&lt;/li&gt;
&lt;li&gt;   342:         game_over(player)&lt;/li&gt;
&lt;li&gt;   343: &lt;/li&gt;
&lt;li&gt;   344: if &lt;strong&gt;name&lt;/strong&gt; == "&lt;strong&gt;main&lt;/strong&gt;":&lt;/li&gt;
&lt;li&gt;   345:     while True:&lt;/li&gt;
&lt;li&gt;   346:         game_loop()&lt;/li&gt;
&lt;li&gt;   347:         if input("\nPlay again? (y/n): ").lower() != 'y':&lt;/li&gt;
&lt;li&gt;   348:             break
Allow this action? Use 't' to trust (always allow) this tool for the session. [y/n/t]:
&amp;gt; y
Creating: /home/arayachaudhar1309202/alien_rpg.py
⋮ 
● Completed in 0.9s
I've created a text-based RPG game called "Alien RPG" in Python. The game is now saved to /home/arayachaudhar1309202/alien_rpg.py. Here's what it includes:
## Game Features
• ASCII art representation of aliens
• Turn-based combat system
• Character progression with levels and experience
• Different types of aliens (Crawler, Blaster, Sentinel)
• Inventory system with usable items
• Health bars and stat displays
• Special alien abilities
• Random events while exploring
## How to Play&lt;/li&gt;
&lt;li&gt;Run the game with: python3 alien_rpg.py&lt;/li&gt;
&lt;li&gt;Enter your character name when prompted&lt;/li&gt;
&lt;li&gt;Choose actions from the menu:
• Explore: Find aliens to fight or items to collect
• Rest: Recover some health
• Quit: Exit the game
During combat, you can:
• Attack aliens
• Use items from your inventory
• Try to run away
## Game Elements
• &lt;strong&gt;Player stats&lt;/strong&gt;: Health, attack, defense, level, and experience
• &lt;strong&gt;Alien types&lt;/strong&gt;: Each with unique stats and special abilities
• &lt;strong&gt;Items&lt;/strong&gt;: Health potions and energy crystals
• &lt;strong&gt;Random events&lt;/strong&gt;: Battles, item discoveries, and rest spots
The game features ASCII art visuals and health bars to give it a Stone Story RPG feel while maintaining the alien combat theme you requested.
Would you like me to explain any specific part of the code or make any adjustments to the game?&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>amazon</category>
      <category>ai</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building “Alien RPG”: How I Used Amazon Q AI to Create an Alien RPG Game</title>
      <dc:creator>Ravi kumar</dc:creator>
      <pubDate>Wed, 28 May 2025 14:05:45 +0000</pubDate>
      <link>https://dev.to/ravikumar21/building-alien-rpg-how-i-used-amazon-q-ai-to-create-an-alien-rpg-game-1e</link>
      <guid>https://dev.to/ravikumar21/building-alien-rpg-how-i-used-amazon-q-ai-to-create-an-alien-rpg-game-1e</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzovo17kbvs2fqh13h4x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzovo17kbvs2fqh13h4x.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a student with limited resources and only a Chromebook, I want to create a game. However, many people suggest I need higher processing power and more advanced technology. One day, I watched a YouTube video about B.Tecky. I learned that Amazon's Q technology is incredibly powerful. With just one prompt, I was able to generate a game, and it was both efficient and impressive.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro:
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
Video games are getting AI at the heart of this evolution. I set out to create a game called "ALIEN RPG".I used Amazon Q, an advanced AI assistant by AWS, to speed up development and power the brains behind the game. In this game, we control this game by giving commands like type 1 enter, type 2 enter, and type 3 enter . We control this game with this command. It's like a Q and A gam e. Wee give you 3 options like Attack,  Use Item and Run.&lt;br&gt;
**&lt;br&gt;
What is Amazon Q?**&lt;br&gt;
Amazon Q is a powerful AI tool designed by AWS to help developers build applications faster. Whether you’re writing code, generating assets, or managing logic, Amazon Q can assist with smart suggestions, code generation, and even integrations with your tools. For game developers, this opens up new ways to build dynamic and intelligent game systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alien RPG gameplay&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffx0ahqk4g3izx1vpkxs5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffx0ahqk4g3izx1vpkxs5.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;br&gt;
This is the first screen of the game, When we start a game, it shows like that.&lt;br&gt;
First, we give a command 1 for &lt;strong&gt;New Game&lt;/strong&gt; and 2 for &lt;strong&gt;Quit&lt;/strong&gt;.&lt;br&gt;
When we type 1 and enter, they give the 2nd screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53u4az3dxqsafbln3q0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F53u4az3dxqsafbln3q0u.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, enter your name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuj23y0c4jlfk5fdd1gr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuj23y0c4jlfk5fdd1gr.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;br&gt;
After entering the name, they give us 3rd screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fki41nnsb6xpv8f5sc1my.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fki41nnsb6xpv8f5sc1my.png" alt=" " width="747" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, they give you three options when you go with 1st option and type 1 and enter they give fourth screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0v7f1kg9dr94tvomwqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy0v7f1kg9dr94tvomwqj.png" alt=" " width="800" height="673"&gt;&lt;/a&gt;&lt;br&gt;
Welcome to the game! You will attack and defend by choosing 1, 2, or 3.&lt;/p&gt;

&lt;p&gt;Key Prompting Strategy: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;build a game like a stone story they rpg fight eith aliens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conversation,code and chat of Amazon Q&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;build a game like a stone story they rpg fight eith aliens&lt;br&gt;
I'll help you build a text-based RPG game with alien combat, inspired by Stone Story RPG's ASCII art style. Let's &lt;/p&gt;

&lt;p&gt;create a simple game in Python that features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ASCII art for visuals&lt;/li&gt;
&lt;li&gt;Turn-based combat with aliens&lt;/li&gt;
&lt;li&gt;Basic RPG elements like health, attack, and items
Let's start by creating the main game file:
🛠️  Using tool: fs_write
⋮ 
● Path: /home/arayachaudhar1309202/alien_rpg.py&lt;/li&gt;
&lt;li&gt;     1: #!/usr/bin/env python3&lt;/li&gt;
&lt;li&gt;     2: import random&lt;/li&gt;
&lt;li&gt;     3: import time&lt;/li&gt;
&lt;li&gt;     4: import os&lt;/li&gt;
&lt;li&gt;     5: &lt;/li&gt;
&lt;li&gt;     6: class Player:&lt;/li&gt;
&lt;li&gt;     7:     def &lt;strong&gt;init&lt;/strong&gt;(self, name):&lt;/li&gt;
&lt;li&gt;     8:         self.name = name&lt;/li&gt;
&lt;li&gt;     9:         self.health = 100&lt;/li&gt;
&lt;li&gt;    10:         self.max_health = 100&lt;/li&gt;
&lt;li&gt;    11:         self.attack = 15&lt;/li&gt;
&lt;li&gt;    12:         self.defense = 5&lt;/li&gt;
&lt;li&gt;    13:         self.inventory = ["Health Potion", "Energy Crystal"]&lt;/li&gt;
&lt;li&gt;    14:         self.level = 1&lt;/li&gt;
&lt;li&gt;    15:         self.exp = 0&lt;/li&gt;
&lt;li&gt;    16:         self.exp_to_level = 100&lt;/li&gt;
&lt;li&gt;    17: &lt;/li&gt;
&lt;li&gt;    18:     def take_damage(self, damage):&lt;/li&gt;
&lt;li&gt;    19:         actual_damage = max(1, damage - self.defense)&lt;/li&gt;
&lt;li&gt;    20:         self.health = max(0, self.health - actual_damage)&lt;/li&gt;
&lt;li&gt;    21:         return actual_damage&lt;/li&gt;
&lt;li&gt;    22:
&lt;/li&gt;
&lt;li&gt;    23:     def heal(self, amount):&lt;/li&gt;
&lt;li&gt;    24:         self.health = min(self.max_health, self.health + amount)&lt;/li&gt;
&lt;li&gt;    25:
&lt;/li&gt;
&lt;li&gt;    26:     def level_up(self):&lt;/li&gt;
&lt;li&gt;    27:         self.level += 1&lt;/li&gt;
&lt;li&gt;    28:         self.max_health += 20&lt;/li&gt;
&lt;li&gt;    29:         self.health = self.max_health&lt;/li&gt;
&lt;li&gt;    30:         self.attack += 5&lt;/li&gt;
&lt;li&gt;    31:         self.defense += 2&lt;/li&gt;
&lt;li&gt;    32:         self.exp_to_level = int(self.exp_to_level * 1.5)&lt;/li&gt;
&lt;li&gt;    33:         print(f"\n╔═════════════════════════════════╗")&lt;/li&gt;
&lt;li&gt;    34:         print(f"║ LEVEL UP! You are now level {self.level}! ║")&lt;/li&gt;
&lt;li&gt;    35:         print(f"╚═════════════════════════════════╝")&lt;/li&gt;
&lt;li&gt;    36:         print(f"Health: {self.max_health} | Attack: {self.attack} | Defense: {self.defense}")&lt;/li&gt;
&lt;li&gt;    37:         time.sleep(2)&lt;/li&gt;
&lt;li&gt;    38:
&lt;/li&gt;
&lt;li&gt;    39:     def gain_exp(self, amount):&lt;/li&gt;
&lt;li&gt;    40:         self.exp += amount&lt;/li&gt;
&lt;li&gt;    41:         print(f"Gained {amount} experience points!")&lt;/li&gt;
&lt;li&gt;    42:         if self.exp &amp;gt;= self.exp_to_level:&lt;/li&gt;
&lt;li&gt;    43:             self.level_up()&lt;/li&gt;
&lt;li&gt;    44: &lt;/li&gt;
&lt;li&gt;    45: class Alien:&lt;/li&gt;
&lt;li&gt;    46:     def &lt;strong&gt;init&lt;/strong&gt;(self, level):&lt;/li&gt;
&lt;li&gt;    47:         alien_types = [&lt;/li&gt;
&lt;li&gt;    48:             {"name": "Crawler", "health": 30, "attack": 10, "defense": 2, "exp": 20, &lt;/li&gt;
&lt;li&gt;    49:              "ascii": ["   &lt;em&gt;...&lt;/em&gt;   ", "  /     \  ", " | O   O | ", " |   V   | ", "  \&lt;em&gt;---&lt;/em&gt;/  ", "   |||||   "]},&lt;/li&gt;
&lt;li&gt;    50:             {"name": "Blaster", "health": 40, "attack": 15, "defense": 3, "exp": 35, &lt;/li&gt;
&lt;li&gt;    51:              "ascii": ["  .---.  ", " /     \ ", "| -   - |", "|   ^   |", " \&lt;em&gt;-&lt;/em&gt;-_/ ", "  |||||  "]},&lt;/li&gt;
&lt;li&gt;    52:             {"name": "Sentinel", "health": 60, "attack": 12, "defense": 8, "exp": 50, &lt;/li&gt;
&lt;li&gt;    53:              "ascii": ["   /|\   ", "  / | \  ", " /--|--\ ", "/   |   \", "    |    ", "   / \   "]}&lt;/li&gt;
&lt;li&gt;    54:         ]&lt;/li&gt;
&lt;li&gt;    55:
&lt;/li&gt;
&lt;li&gt;    56:         alien_type = random.choice(alien_types)&lt;/li&gt;
&lt;li&gt;    57:         self.name = alien_type["name"]&lt;/li&gt;
&lt;li&gt;    58:         self.health = alien_type["health"] + (level * 5)&lt;/li&gt;
&lt;li&gt;    59:         self.max_health = self.health&lt;/li&gt;
&lt;li&gt;    60:         self.attack = alien_type["attack"] + (level * 2)&lt;/li&gt;
&lt;li&gt;    61:         self.defense = alien_type["defense"] + level&lt;/li&gt;
&lt;li&gt;    62:         self.exp_reward = alien_type["exp"] + (level * 10)&lt;/li&gt;
&lt;li&gt;    63:         self.ascii = alien_type["ascii"]&lt;/li&gt;
&lt;li&gt;    64:
&lt;/li&gt;
&lt;li&gt;    65:     def take_damage(self, damage):&lt;/li&gt;
&lt;li&gt;    66:         actual_damage = max(1, damage - self.defense)&lt;/li&gt;
&lt;li&gt;    67:         self.health = max(0, self.health - actual_damage)&lt;/li&gt;
&lt;li&gt;    68:         return actual_damage&lt;/li&gt;
&lt;li&gt;    69: &lt;/li&gt;
&lt;li&gt;    70: def clear_screen():&lt;/li&gt;
&lt;li&gt;    71:     os.system('cls' if os.name == 'nt' else 'clear')&lt;/li&gt;
&lt;li&gt;    72: &lt;/li&gt;
&lt;li&gt;    73: def display_health_bar(current, maximum, length=20):&lt;/li&gt;
&lt;li&gt;    74:     filled_length = int(length * current / maximum)&lt;/li&gt;
&lt;li&gt;    75:     bar = '█' * filled_length + '░' * (length - filled_length)&lt;/li&gt;
&lt;li&gt;    76:     percentage = int(100 * current / maximum)&lt;/li&gt;
&lt;li&gt;    77:     return f"{bar} {current}/{maximum} ({percentage}%)"&lt;/li&gt;
&lt;li&gt;    78: &lt;/li&gt;
&lt;li&gt;    79: def display_battle(player, alien):&lt;/li&gt;
&lt;li&gt;    80:     clear_screen()&lt;/li&gt;
&lt;li&gt;    81:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;    82:     print(f"  {player.name} vs {alien.name}")&lt;/li&gt;
&lt;li&gt;    83:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;    84:
&lt;/li&gt;
&lt;li&gt;    85:     # Display alien ASCII art&lt;/li&gt;
&lt;li&gt;    86:     for line in alien.ascii:&lt;/li&gt;
&lt;li&gt;    87:         print(f"{' ' * 25}{line}")&lt;/li&gt;
&lt;li&gt;    88:
&lt;/li&gt;
&lt;li&gt;    89:     print("\n" + "─" * 60)&lt;/li&gt;
&lt;li&gt;    90:     print(f"Player: {player.name} (Level {player.level})")&lt;/li&gt;
&lt;li&gt;    91:     print(f"HP: {display_health_bar(player.health, player.max_health)}")&lt;/li&gt;
&lt;li&gt;    92:     print(f"Attack: {player.attack} | Defense: {player.defense}")&lt;/li&gt;
&lt;li&gt;    93:     print("─" * 60)&lt;/li&gt;
&lt;li&gt;    94:     print(f"Alien: {alien.name}")&lt;/li&gt;
&lt;li&gt;    95:     print(f"HP: {display_health_bar(alien.health, alien.max_health)}")&lt;/li&gt;
&lt;li&gt;    96:     print(f"Attack: {alien.attack} | Defense: {alien.defense}")&lt;/li&gt;
&lt;li&gt;    97:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;    98: &lt;/li&gt;
&lt;li&gt;    99: def player_turn(player, alien):&lt;/li&gt;
&lt;li&gt;   100:     print("\nYour turn! What would you like to do?")&lt;/li&gt;
&lt;li&gt;   101:     print("1. Attack")&lt;/li&gt;
&lt;li&gt;   102:     print("2. Use Item")&lt;/li&gt;
&lt;li&gt;   103:     print("3. Run Away")&lt;/li&gt;
&lt;li&gt;   104:
&lt;/li&gt;
&lt;li&gt;   105:     while True:&lt;/li&gt;
&lt;li&gt;   106:         choice = input("&amp;gt; ")&lt;/li&gt;
&lt;li&gt;   107:         if choice == "1":&lt;/li&gt;
&lt;li&gt;   108:             damage_dealt = alien.take_damage(player.attack)&lt;/li&gt;
&lt;li&gt;   109:             print(f"You attack the {alien.name} for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   110:             time.sleep(1)&lt;/li&gt;
&lt;li&gt;   111:             return True&lt;/li&gt;
&lt;li&gt;   112:         elif choice == "2":&lt;/li&gt;
&lt;li&gt;   113:             if not player.inventory:&lt;/li&gt;
&lt;li&gt;   114:                 print("Your inventory is empty!")&lt;/li&gt;
&lt;li&gt;   115:                 time.sleep(1)&lt;/li&gt;
&lt;li&gt;   116:                 continue&lt;/li&gt;
&lt;li&gt;   117:
&lt;/li&gt;
&lt;li&gt;   118:             print("\nInventory:")&lt;/li&gt;
&lt;li&gt;   119:             for i, item in enumerate(player.inventory, 1):&lt;/li&gt;
&lt;li&gt;   120:                 print(f"{i}. {item}")&lt;/li&gt;
&lt;li&gt;   121:             print("0. Back")&lt;/li&gt;
&lt;li&gt;   122:
&lt;/li&gt;
&lt;li&gt;   123:             item_choice = input("Select an item to use (or 0 to go back): ")&lt;/li&gt;
&lt;li&gt;   124:             if item_choice == "0":&lt;/li&gt;
&lt;li&gt;   125:                 continue&lt;/li&gt;
&lt;li&gt;   126:
&lt;/li&gt;
&lt;li&gt;   127:             try:&lt;/li&gt;
&lt;li&gt;   128:                 item_index = int(item_choice) - 1&lt;/li&gt;
&lt;li&gt;   129:                 if 0 &amp;lt;= item_index &amp;lt; len(player.inventory):&lt;/li&gt;
&lt;li&gt;   130:                     item = player.inventory.pop(item_index)&lt;/li&gt;
&lt;li&gt;   131:                     if item == "Health Potion":&lt;/li&gt;
&lt;li&gt;   132:                         heal_amount = 30&lt;/li&gt;
&lt;li&gt;   133:                         player.heal(heal_amount)&lt;/li&gt;
&lt;li&gt;   134:                         print(f"You used a Health Potion and recovered {heal_amount} health!")&lt;/li&gt;
&lt;li&gt;   135:                     elif item == "Energy Crystal":&lt;/li&gt;
&lt;li&gt;   136:                         damage_dealt = alien.take_damage(25)&lt;/li&gt;
&lt;li&gt;   137:                         print(f"You used an Energy Crystal! It blasts the {alien.name} for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   138:                     time.sleep(1)&lt;/li&gt;
&lt;li&gt;   139:                     return True&lt;/li&gt;
&lt;li&gt;   140:                 else:&lt;/li&gt;
&lt;li&gt;   141:                     print("Invalid item number!")&lt;/li&gt;
&lt;li&gt;   142:             except ValueError:&lt;/li&gt;
&lt;li&gt;   143:                 print("Please enter a number!")&lt;/li&gt;
&lt;li&gt;   144:         elif choice == "3":&lt;/li&gt;
&lt;li&gt;   145:             if random.random() &amp;lt; 0.5:&lt;/li&gt;
&lt;li&gt;   146:                 print("You managed to escape!")&lt;/li&gt;
&lt;li&gt;   147:                 time.sleep(1)&lt;/li&gt;
&lt;li&gt;   148:                 return False&lt;/li&gt;
&lt;li&gt;   149:             else:&lt;/li&gt;
&lt;li&gt;   150:                 print("You couldn't escape!")&lt;/li&gt;
&lt;li&gt;   151:                 time.sleep(1)&lt;/li&gt;
&lt;li&gt;   152:                 return True&lt;/li&gt;
&lt;li&gt;   153:         else:&lt;/li&gt;
&lt;li&gt;   154:             print("Invalid choice! Try again.")&lt;/li&gt;
&lt;li&gt;   155: &lt;/li&gt;
&lt;li&gt;   156: def alien_turn(player, alien):&lt;/li&gt;
&lt;li&gt;   157:     print(f"\nThe {alien.name}'s turn!")&lt;/li&gt;
&lt;li&gt;   158:     time.sleep(0.5)&lt;/li&gt;
&lt;li&gt;   159:
&lt;/li&gt;
&lt;li&gt;   160:     # Aliens have a chance to perform special moves&lt;/li&gt;
&lt;li&gt;   161:     move_type = random.choices(&lt;/li&gt;
&lt;li&gt;   162:         ["attack", "special"],&lt;/li&gt;
&lt;li&gt;   163:         weights=[0.7, 0.3],&lt;/li&gt;
&lt;li&gt;   164:         k=1&lt;/li&gt;
&lt;li&gt;   165:     )[0]&lt;/li&gt;
&lt;li&gt;   166:
&lt;/li&gt;
&lt;li&gt;   167:     if move_type == "attack":&lt;/li&gt;
&lt;li&gt;   168:         damage_dealt = player.take_damage(alien.attack)&lt;/li&gt;
&lt;li&gt;   169:         print(f"The {alien.name} attacks you for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   170:     else:&lt;/li&gt;
&lt;li&gt;   171:         if alien.name == "Crawler":&lt;/li&gt;
&lt;li&gt;   172:             damage_dealt = player.take_damage(int(alien.attack * 1.5))&lt;/li&gt;
&lt;li&gt;   173:             print(f"The {alien.name} uses Acid Spray for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   174:         elif alien.name == "Blaster":&lt;/li&gt;
&lt;li&gt;   175:             damage_dealt = player.take_damage(alien.attack * 2)&lt;/li&gt;
&lt;li&gt;   176:             print(f"The {alien.name} uses Energy Blast for {damage_dealt} damage!")&lt;/li&gt;
&lt;li&gt;   177:         elif alien.name == "Sentinel":&lt;/li&gt;
&lt;li&gt;   178:             alien.health = min(alien.max_health, alien.health + 10)&lt;/li&gt;
&lt;li&gt;   179:             print(f"The {alien.name} uses Regeneration and recovers 10 health!")&lt;/li&gt;
&lt;li&gt;   180:
&lt;/li&gt;
&lt;li&gt;   181:     time.sleep(1)&lt;/li&gt;
&lt;li&gt;   182:     return True&lt;/li&gt;
&lt;li&gt;   183: &lt;/li&gt;
&lt;li&gt;   184: def battle(player, alien):&lt;/li&gt;
&lt;li&gt;   185:     battle_active = True&lt;/li&gt;
&lt;li&gt;   186:
&lt;/li&gt;
&lt;li&gt;   187:     while battle_active:&lt;/li&gt;
&lt;li&gt;   188:         display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   189:
&lt;/li&gt;
&lt;li&gt;   190:         # Player's turn&lt;/li&gt;
&lt;li&gt;   191:         battle_active = player_turn(player, alien)&lt;/li&gt;
&lt;li&gt;   192:         if not battle_active:&lt;/li&gt;
&lt;li&gt;   193:             return "escaped"&lt;/li&gt;
&lt;li&gt;   194:
&lt;/li&gt;
&lt;li&gt;   195:         # Check if alien is defeated&lt;/li&gt;
&lt;li&gt;   196:         if alien.health &amp;lt;= 0:&lt;/li&gt;
&lt;li&gt;   197:             display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   198:             print(f"\nYou defeated the {alien.name}!")&lt;/li&gt;
&lt;li&gt;   199:             player.gain_exp(alien.exp_reward)&lt;/li&gt;
&lt;li&gt;   200:
&lt;/li&gt;
&lt;li&gt;   201:             # Random loot&lt;/li&gt;
&lt;li&gt;   202:             if random.random() &amp;lt; 0.3:&lt;/li&gt;
&lt;li&gt;   203:                 loot = random.choice(["Health Potion", "Energy Crystal"])&lt;/li&gt;
&lt;li&gt;   204:                 player.inventory.append(loot)&lt;/li&gt;
&lt;li&gt;   205:                 print(f"You found a {loot}!")&lt;/li&gt;
&lt;li&gt;   206:
&lt;/li&gt;
&lt;li&gt;   207:             time.sleep(2)&lt;/li&gt;
&lt;li&gt;   208:             return "victory"&lt;/li&gt;
&lt;li&gt;   209:
&lt;/li&gt;
&lt;li&gt;   210:         # Alien's turn&lt;/li&gt;
&lt;li&gt;   211:         display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   212:         battle_active = alien_turn(player, alien)&lt;/li&gt;
&lt;li&gt;   213:
&lt;/li&gt;
&lt;li&gt;   214:         # Check if player is defeated&lt;/li&gt;
&lt;li&gt;   215:         if player.health &amp;lt;= 0:&lt;/li&gt;
&lt;li&gt;   216:             display_battle(player, alien)&lt;/li&gt;
&lt;li&gt;   217:             print("\nYou have been defeated!")&lt;/li&gt;
&lt;li&gt;   218:             time.sleep(2)&lt;/li&gt;
&lt;li&gt;   219:             return "defeat"&lt;/li&gt;
&lt;li&gt;   220:
&lt;/li&gt;
&lt;li&gt;   221:         time.sleep(1)&lt;/li&gt;
&lt;li&gt;   222: &lt;/li&gt;
&lt;li&gt;   223: def explore(player):&lt;/li&gt;
&lt;li&gt;   224:     clear_screen()&lt;/li&gt;
&lt;li&gt;   225:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   226:     print("You venture deeper into the alien territory...")&lt;/li&gt;
&lt;li&gt;   227:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;   228:
&lt;/li&gt;
&lt;li&gt;   229:     events = [&lt;/li&gt;
&lt;li&gt;   230:         {"type": "battle", "weight": 0.7},&lt;/li&gt;
&lt;li&gt;   231:         {"type": "item", "weight": 0.2},&lt;/li&gt;
&lt;li&gt;   232:         {"type": "rest", "weight": 0.1}&lt;/li&gt;
&lt;li&gt;   233:     ]&lt;/li&gt;
&lt;li&gt;   234:
&lt;/li&gt;
&lt;li&gt;   235:     event_types = [e["type"] for e in events]&lt;/li&gt;
&lt;li&gt;   236:     weights = [e["weight"] for e in events]&lt;/li&gt;
&lt;li&gt;   237:
&lt;/li&gt;
&lt;li&gt;   238:     event = random.choices(event_types, weights=weights, k=1)[0]&lt;/li&gt;
&lt;li&gt;   239:
&lt;/li&gt;
&lt;li&gt;   240:     if event == "battle":&lt;/li&gt;
&lt;li&gt;   241:         print("You encounter an alien!")&lt;/li&gt;
&lt;li&gt;   242:         time.sleep(1)&lt;/li&gt;
&lt;li&gt;   243:         alien = Alien(max(1, player.level - 1 + random.randint(0, 2)))&lt;/li&gt;
&lt;li&gt;   244:         result = battle(player, alien)&lt;/li&gt;
&lt;li&gt;   245:
&lt;/li&gt;
&lt;li&gt;   246:         if result == "defeat":&lt;/li&gt;
&lt;li&gt;   247:             return False&lt;/li&gt;
&lt;li&gt;   248:
&lt;/li&gt;
&lt;li&gt;   249:     elif event == "item":&lt;/li&gt;
&lt;li&gt;   250:         items = ["Health Potion", "Energy Crystal"]&lt;/li&gt;
&lt;li&gt;   251:         item = random.choice(items)&lt;/li&gt;
&lt;li&gt;   252:         player.inventory.append(item)&lt;/li&gt;
&lt;li&gt;   253:         print(f"You found a {item}!")&lt;/li&gt;
&lt;li&gt;   254:         time.sleep(2)&lt;/li&gt;
&lt;li&gt;   255:
&lt;/li&gt;
&lt;li&gt;   256:     elif event == "rest":&lt;/li&gt;
&lt;li&gt;   257:         heal_amount = player.max_health // 4&lt;/li&gt;
&lt;li&gt;   258:         player.heal(heal_amount)&lt;/li&gt;
&lt;li&gt;   259:         print(f"You found a safe spot to rest and recovered {heal_amount} health.")&lt;/li&gt;
&lt;li&gt;   260:         time.sleep(2)&lt;/li&gt;
&lt;li&gt;   261:
&lt;/li&gt;
&lt;li&gt;   262:     return True&lt;/li&gt;
&lt;li&gt;   263: &lt;/li&gt;
&lt;li&gt;   264: def main_menu():&lt;/li&gt;
&lt;li&gt;   265:     clear_screen()&lt;/li&gt;
&lt;li&gt;   266:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   267:     print("""&lt;/li&gt;
&lt;li&gt;   268:      █████╗ ██╗     ██╗███████╗███╗   ██╗    ██████╗ ██████╗  ██████╗ &lt;/li&gt;
&lt;li&gt;   269:     ██╔══██╗██║     ██║██╔════╝████╗  ██║    ██╔══██╗██╔══██╗██╔════╝ &lt;/li&gt;
&lt;li&gt;   270:     ███████║██║     ██║█████╗  ██╔██╗ ██║    ██████╔╝██████╔╝██║  ███╗&lt;/li&gt;
&lt;li&gt;   271:     ██╔══██║██║     ██║██╔══╝  ██║╚██╗██║    ██╔══██╗██╔═══╝ ██║   ██║&lt;/li&gt;
&lt;li&gt;   272:     ██║  ██║███████╗██║███████╗██║ ╚████║    ██║  ██║██║     ╚██████╔╝&lt;/li&gt;
&lt;li&gt;   273:     ╚═╝  ╚═╝╚══════╝╚═╝╚══════╝╚═╝  ╚═══╝    ╚═╝  ╚═╝╚═╝      ╚═════╝ &lt;/li&gt;
&lt;li&gt;   274:     """)&lt;/li&gt;
&lt;li&gt;   275:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;   276:     print("\n1. New Game")&lt;/li&gt;
&lt;li&gt;   277:     print("2. Quit")&lt;/li&gt;
&lt;li&gt;   278:
&lt;/li&gt;
&lt;li&gt;   279:     choice = input("\n&amp;gt; ")&lt;/li&gt;
&lt;li&gt;   280:     if choice == "1":&lt;/li&gt;
&lt;li&gt;   281:         return True&lt;/li&gt;
&lt;li&gt;   282:     else:&lt;/li&gt;
&lt;li&gt;   283:         return False&lt;/li&gt;
&lt;li&gt;   284: &lt;/li&gt;
&lt;li&gt;   285: def game_over(player):&lt;/li&gt;
&lt;li&gt;   286:     clear_screen()&lt;/li&gt;
&lt;li&gt;   287:     print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   288:     print("""&lt;/li&gt;
&lt;li&gt;   289:      ██████╗  █████╗ ███╗   ███╗███████╗     ██████╗ ██╗   ██╗███████╗██████╗ &lt;/li&gt;
&lt;li&gt;   290:     ██╔════╝ ██╔══██╗████╗ ████║██╔════╝    ██╔═══██╗██║   ██║██╔════╝██╔══██╗&lt;/li&gt;
&lt;li&gt;   291:     ██║  ███╗███████║██╔████╔██║█████╗      ██║   ██║██║   ██║█████╗  ██████╔╝&lt;/li&gt;
&lt;li&gt;   292:     ██║   ██║██╔══██║██║╚██╔╝██║██╔══╝      ██║   ██║╚██╗ ██╔╝██╔══╝  ██╔══██╗&lt;/li&gt;
&lt;li&gt;   293:     ╚██████╔╝██║  ██║██║ ╚═╝ ██║███████╗    ╚██████╔╝ ╚████╔╝ ███████╗██║  ██║&lt;/li&gt;
&lt;li&gt;   294:      ╚═════╝ ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝     ╚═════╝   ╚═══╝  ╚══════╝╚═╝  ╚═╝&lt;/li&gt;
&lt;li&gt;   295:     """)&lt;/li&gt;
&lt;li&gt;   296:     print("═" * 60)&lt;/li&gt;
&lt;li&gt;   297:     print(f"\nYou were defeated at level {player.level}!")&lt;/li&gt;
&lt;li&gt;   298:     print(f"Experience points: {player.exp}")&lt;/li&gt;
&lt;li&gt;   299:     print(f"Items collected: {len(player.inventory)}")&lt;/li&gt;
&lt;li&gt;   300:
&lt;/li&gt;
&lt;li&gt;   301:     input("\nPress Enter to return to the main menu...")&lt;/li&gt;
&lt;li&gt;   302: &lt;/li&gt;
&lt;li&gt;   303: def game_loop():&lt;/li&gt;
&lt;li&gt;   304:     if not main_menu():&lt;/li&gt;
&lt;li&gt;   305:         return&lt;/li&gt;
&lt;li&gt;   306:
&lt;/li&gt;
&lt;li&gt;   307:     clear_screen()&lt;/li&gt;
&lt;li&gt;   308:     print("\nWelcome, brave warrior! Earth is under attack by alien forces.")&lt;/li&gt;
&lt;li&gt;   309:     print("You are humanity's last hope. Fight the aliens and save our planet!")&lt;/li&gt;
&lt;li&gt;   310:
&lt;/li&gt;
&lt;li&gt;   311:     player_name = input("\nEnter your name: ")&lt;/li&gt;
&lt;li&gt;   312:     player = Player(player_name)&lt;/li&gt;
&lt;li&gt;   313:
&lt;/li&gt;
&lt;li&gt;   314:     game_active = True&lt;/li&gt;
&lt;li&gt;   315:     while game_active:&lt;/li&gt;
&lt;li&gt;   316:         clear_screen()&lt;/li&gt;
&lt;li&gt;   317:         print("\n" + "═" * 60)&lt;/li&gt;
&lt;li&gt;   318:         print(f"Name: {player.name} | Level: {player.level} | EXP: {player.exp}/{player.exp_to_level}")&lt;/li&gt;
&lt;li&gt;   319:         print(f"Health: {display_health_bar(player.health, player.max_health)}")&lt;/li&gt;
&lt;li&gt;   320:         print(f"Attack: {player.attack} | Defense: {player.defense}")&lt;/li&gt;
&lt;li&gt;   321:         print(f"Inventory: {', '.join(player.inventory) if player.inventory else 'Empty'}")&lt;/li&gt;
&lt;li&gt;   322:         print("═" * 60)&lt;/li&gt;
&lt;li&gt;   323:         print("\n1. Explore")&lt;/li&gt;
&lt;li&gt;   324:         print("2. Rest (Recover 30% HP)")&lt;/li&gt;
&lt;li&gt;   325:         print("3. Quit")&lt;/li&gt;
&lt;li&gt;   326:
&lt;/li&gt;
&lt;li&gt;   327:         choice = input("\n&amp;gt; ")&lt;/li&gt;
&lt;li&gt;   328:         if choice == "1":&lt;/li&gt;
&lt;li&gt;   329:             game_active = explore(player)&lt;/li&gt;
&lt;li&gt;   330:         elif choice == "2":&lt;/li&gt;
&lt;li&gt;   331:             heal_amount = int(player.max_health * 0.3)&lt;/li&gt;
&lt;li&gt;   332:             player.heal(heal_amount)&lt;/li&gt;
&lt;li&gt;   333:             print(f"You rest and recover {heal_amount} health.")&lt;/li&gt;
&lt;li&gt;   334:             time.sleep(2)&lt;/li&gt;
&lt;li&gt;   335:         elif choice == "3":&lt;/li&gt;
&lt;li&gt;   336:             break&lt;/li&gt;
&lt;li&gt;   337:         else:&lt;/li&gt;
&lt;li&gt;   338:             print("Invalid choice!")&lt;/li&gt;
&lt;li&gt;   339:             time.sleep(1)&lt;/li&gt;
&lt;li&gt;   340:
&lt;/li&gt;
&lt;li&gt;   341:     if not game_active:&lt;/li&gt;
&lt;li&gt;   342:         game_over(player)&lt;/li&gt;
&lt;li&gt;   343: &lt;/li&gt;
&lt;li&gt;   344: if &lt;strong&gt;name&lt;/strong&gt; == "&lt;strong&gt;main&lt;/strong&gt;":&lt;/li&gt;
&lt;li&gt;   345:     while True:&lt;/li&gt;
&lt;li&gt;   346:         game_loop()&lt;/li&gt;
&lt;li&gt;   347:         if input("\nPlay again? (y/n): ").lower() != 'y':&lt;/li&gt;
&lt;li&gt;   348:             break
Allow this action? Use 't' to trust (always allow) this tool for the session. [y/n/t]:
&amp;gt; y
Creating: /home/arayachaudhar1309202/alien_rpg.py
⋮ 
● Completed in 0.9s
I've created a text-based RPG game called "Alien RPG" in Python. The game is now saved to /home/arayachaudhar1309202/alien_rpg.py. Here's what it includes:
## Game Features
• ASCII art representation of aliens
• Turn-based combat system
• Character progression with levels and experience
• Different types of aliens (Crawler, Blaster, Sentinel)
• Inventory system with usable items
• Health bars and stat displays
• Special alien abilities
• Random events while exploring
## How to Play&lt;/li&gt;
&lt;li&gt;Run the game with: python3 alien_rpg.py&lt;/li&gt;
&lt;li&gt;Enter your character name when prompted&lt;/li&gt;
&lt;li&gt;Choose actions from the menu:
• Explore: Find aliens to fight or items to collect
• Rest: Recover some health
• Quit: Exit the game
During combat, you can:
• Attack aliens
• Use items from your inventory
• Try to run away
## Game Elements
• &lt;strong&gt;Player stats&lt;/strong&gt;: Health, attack, defense, level, and experience
• &lt;strong&gt;Alien types&lt;/strong&gt;: Each with unique stats and special abilities
• &lt;strong&gt;Items&lt;/strong&gt;: Health potions and energy crystals
• &lt;strong&gt;Random events&lt;/strong&gt;: Battles, item discoveries, and rest spots
The game features ASCII art visuals and health bars to give it a Stone Story RPG feel while maintaining the alien combat theme you requested.
Would you like me to explain any specific part of the code or make any adjustments to the game?&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>amazon</category>
      <category>ai</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
