{"id":152,"date":"2026-05-08T15:26:56","date_gmt":"2026-05-08T15:26:56","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/l_smith\/?p=152"},"modified":"2026-05-08T15:26:56","modified_gmt":"2026-05-08T15:26:56","slug":"percy-jackson-life-sim","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/l_smith\/2026\/05\/08\/percy-jackson-life-sim\/","title":{"rendered":"Percy jackson life sim"},"content":{"rendered":"\n<figure class=\"wp-block-video\"><\/figure>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1024\" style=\"aspect-ratio: 1920 \/ 1024;\" width=\"1920\" controls src=\"https:\/\/theroyalscode.com\/students\/l_smith\/wp-content\/uploads\/2026\/05\/20260508-1512-06.7604702.mp4\"><\/video><\/figure>\n\n\n\n<p>frist video doesent show all work 2nd video shows code so far <\/p>\n\n\n\n<p>this was a pygame at frist then it was a website then it was back to a pygame and yes i know there is eorrs and that will be next <\/p>\n\n\n\n<p>the base code is already almost done <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pygame\n\n# --- THE MEGA DATABASE ---\n# This stores every character's core \"RPG\" stats\nALL_CHARACTERS = {\n    # The Seven of the Prophecy\n    \"Percy\":    {\"parent\": \"Poseidon\", \"power\": \"Hydrokinesis\", \"hp\": 150, \"speed\": 5, \"weapon\": \"Riptide\"},\n    \"Annabeth\": {\"parent\": \"Athena\",   \"power\": \"Strategy\",     \"hp\": 100, \"speed\": 6, \"weapon\": \"Dagger\"},\n    \"Jason\":    {\"parent\": \"Jupiter\",  \"power\": \"Aerokinesis\",  \"hp\": 140, \"speed\": 5, \"weapon\": \"Ivlix\"},\n    \"Piper\":    {\"parent\": \"Aphrodite\",\"power\": \"Charmspeak\",   \"hp\": 90,  \"speed\": 6, \"weapon\": \"Katoptris\"},\n    \"Leo\":      {\"parent\": \"Hephaestus\",\"power\": \"Pyrokinesis\", \"hp\": 110, \"speed\": 6, \"weapon\": \"Tools\"},\n    \"Frank\":    {\"parent\": \"Mars\",     \"power\": \"Shapeshift\",   \"hp\": 180, \"speed\": 4, \"weapon\": \"Bow\"},\n    \"Hazel\":    {\"parent\": \"Pluto\",    \"power\": \"Geokinesis\",   \"hp\": 120, \"speed\": 5, \"weapon\": \"Spatha\"},\n    \n    # Major Supporting Characters\n    \"Nico\":     {\"parent\": \"Hades\",    \"power\": \"Necromancy\",   \"hp\": 100, \"speed\": 7, \"weapon\": \"Stygian Iron\"},\n    \"Thalia\":   {\"parent\": \"Zeus\",     \"power\": \"Electrokinesis\",\"hp\": 130, \"speed\": 7, \"weapon\": \"Aegis\"},\n    \"Reyna\":    {\"parent\": \"Bellona\",  \"power\": \"Lending\",      \"hp\": 140, \"speed\": 5, \"weapon\": \"Spear\"},\n    \"Clarisse\": {\"parent\": \"Ares\",     \"power\": \"Strength\",     \"hp\": 160, \"speed\": 4, \"weapon\": \"Maimer\"},\n    \"Will\":     {\"parent\": \"Apollo\",   \"power\": \"Healing\",      \"hp\": 80,  \"speed\": 5, \"weapon\": \"Medical Kit\"},\n    \"Grover\":   {\"parent\": \"Pan\",      \"power\": \"Nature Magic\", \"hp\": 90,  \"speed\": 6, \"weapon\": \"Reed Pipes\"},\n    \"Luke\":     {\"parent\": \"Hermes\",   \"power\": \"Thievery\",     \"hp\": 140, \"speed\": 8, \"weapon\": \"Backbiter\"}\n}\n\nclass Demigod(pygame.sprite.Sprite):\n    def __init__(self, name, position):\n        super().__init__()\n        if name not in ALL_CHARACTERS:\n            name = \"Percy\" # Default fallback\n            \n        self.data = ALL_CHARACTERS&#91;name]\n        self.name = name\n        \n        # Stat assignment\n        self.hp = self.data&#91;\"hp\"]\n        self.speed = self.data&#91;\"speed\"]\n        self.power = self.data&#91;\"power\"]\n        \n        # Logic for loading the right image\n        # Assumes you have images named 'percy.png', 'annabeth.png', etc.\n        try:\n            self.image = pygame.image.load(f\"assets\/sprites\/{name.lower()}.png\").convert_alpha()\n        except:\n            # Create a placeholder colored square if image is missing\n            self.image = pygame.Surface((50, 50))\n            self.image.fill((218, 165, 32)) # Bronze\/Gold color\n            \n        self.rect = self.image.get_rect(topleft=position)\n\n    def use_ability(self):\n        print(f\"{self.name} uses {self.power}!\")\n        # Add specific ability logic here\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import pygame\nimport sys\n\n# --- SETTINGS &amp; COLORS ---\nWIDTH, HEIGHT = 800, 600\nWHITE = (255, 255, 255)\nGOLD = (218, 165, 32)\nDARK_BG = (20, 20, 20)\nCHAT_BOX = (40, 40, 40)\nYOU_COLOR = (173, 216, 230) # Light Blue\n\n# --- CHARACTER DATA ---\nPERSONAS = {\n    \"Percy\": {\n        \"greeting\": \"Hey! Want some blue cookies or a trip to the lake?\",\n        \"responses\": {\n            \"hello\": \"Sup! Ready for some training?\",\n            \"water\": \"It\u2019s my favorite element. I feel stronger just thinking about it.\",\n            \"annabeth\": \"She's the smartest person I know. Don't tell her I said that.\",\n            \"default\": \"Haha, totally. Anyway, did you see what Clarisse did today?\"\n        }\n    },\n    \"Annabeth\": {\n        \"greeting\": \"I'm busy with blueprints, but I have a minute for strategy.\",\n        \"responses\": {\n            \"hello\": \"Hello. Do you have a plan for today's Capture the Flag?\",\n            \"plan\": \"A good plan is the difference between victory and the infirmary.\",\n            \"percy\": \"He's a Seaweed Brain, but he's my Seaweed Brain.\",\n            \"default\": \"Interesting... I'll have to research that in the library.\"\n        }\n    }\n}\n\nclass DemigodChat:\n    def __init__(self):\n        pygame.init()\n        self.screen = pygame.display.set_mode((WIDTH, HEIGHT))\n        pygame.display.set_caption(\"Camp Half-Blood: Conversations\")\n        self.font = pygame.font.SysFont(\"Georgia\", 22)\n        self.clock = pygame.time.Clock()\n        \n        self.active_char = \"Percy\"\n        self.input_text = \"\"\n        self.chat_history = &#91;(self.active_char, PERSONAS&#91;self.active_char]&#91;\"greeting\"])]\n        self.input_rect = pygame.Rect(50, 530, 700, 40)\n\n    def get_ai_response(self, text):\n        text = text.lower()\n        persona = PERSONAS&#91;self.active_char]\n        response = persona&#91;\"responses\"].get(\"default\")\n        for key in persona&#91;\"responses\"]:\n            if key in text:\n                response = persona&#91;\"responses\"]&#91;key]\n                break\n        return response\n\n    def run(self):\n        while True:\n            self.screen.fill(DARK_BG)\n            \n            for event in pygame.event.get():\n                if event.type == pygame.QUIT:\n                    pygame.quit(); sys.exit()\n                \n                if event.type == pygame.KEYDOWN:\n                    if event.key == pygame.K_RETURN:\n                        if self.input_text.strip():\n                            # User Message\n                            self.chat_history.append((\"You\", self.input_text))\n                            # AI Response\n                            reply = self.get_ai_response(self.input_text)\n                            self.chat_history.append((self.active_char, reply))\n                            self.input_text = \"\"\n                    elif event.key == pygame.K_BACKSPACE:\n                        self.input_text = self.input_text&#91;:-1]\n                    else:\n                        self.input_text += event.unicode\n                \n                if event.type == pygame.MOUSEBUTTONDOWN:\n                    # Tab Switching (Percy Tab)\n                    if 50 &lt;= event.pos&#91;0] &lt;= 150 and 50 &lt;= event.pos&#91;1] &lt;= 90:\n                        self.active_char = \"Percy\"\n                        self.chat_history = &#91;(self.active_char, PERSONAS&#91;\"Percy\"]&#91;\"greeting\"])]\n                    # Tab Switching (Annabeth Tab)\n                    elif 160 &lt;= event.pos&#91;0] &lt;= 260 and 50 &lt;= event.pos&#91;1] &lt;= 90:\n                        self.active_char = \"Annabeth\"\n                        self.chat_history = &#91;(self.active_char, PERSONAS&#91;\"Annabeth\"]&#91;\"greeting\"])]\n\n            self.draw()\n            pygame.display.flip()\n            self.clock.tick(60)\n\n    def draw(self):\n        # Tabs\n        p_color = GOLD if self.active_char == \"Percy\" else CHAT_BOX\n        a_color = GOLD if self.active_char == \"Annabeth\" else CHAT_BOX\n        pygame.draw.rect(self.screen, p_color, (50, 50, 100, 40))\n        pygame.draw.rect(self.screen, a_color, (160, 50, 100, 40))\n        self.screen.blit(self.font.render(\"Percy\", True, WHITE), (65, 60))\n        self.screen.blit(self.font.render(\"Annabeth\", True, WHITE), (165, 60))\n\n        # Chat Area\n        pygame.draw.rect(self.screen, CHAT_BOX, (50, 100, 700, 410))\n        pygame.draw.rect(self.screen, GOLD, (50, 100, 700, 410), 2)\n        \n        # Messages\n        y = 120\n        for sender, text in self.chat_history&#91;-10:]:\n            color = YOU_COLOR if sender == \"You\" else GOLD\n            txt_surf = self.font.render(f\"{sender}: {text}\", True, color)\n            self.screen.blit(txt_surf, (70, y))\n            y += 40\n\n        # Input\n        pygame.draw.rect(self.screen, WHITE, self.input_rect, 2)\n        input_surf = self.font.render(self.input_text, True, WHITE)\n        self.screen.blit(input_surf, (60, 540))\n\nif __name__ == \"__main__\":\n    game = DemigodChat()\n    game.run()\n<\/code><\/pre>\n\n\n\n<p>from today project i learned pygame is compulated (hope i spell that right) and that good coders adapts to the callanges that come up and slove it <\/p>\n\n\n\n<p>and i know i do a lot of simulations projects but thats because with each sim i do it gets harder and harder which means i have to adapt to the new challnage <\/p>\n\n\n\n<p>this project isnt close to done but i am going as fast as  i can<\/p>\n\n\n\n<p>next week keystones so problly no post <\/p>\n\n\n\n<p>im trying to include a ai chat <\/p>\n\n\n\n<p>the reson for this percy jackson is my favorite book so i know the most about it <\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>frist video doesent show all work 2nd video shows code so far this was a pygame at frist then it was a website then it was back to a pygame and yes i know there is eorrs and that will be next the base code is already almost done from today project i learned pygame [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-152","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts\/152\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/posts\/152\/revisions\/154"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/media?parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/categories?post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_smith\/wp-json\/wp\/v2\/tags?post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}