{"id":55,"date":"2026-05-01T14:22:30","date_gmt":"2026-05-01T14:22:30","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/e_henderson\/?p=55"},"modified":"2026-05-01T14:22:30","modified_gmt":"2026-05-01T14:22:30","slug":"free-friday-5-1","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/e_henderson\/2026\/05\/01\/free-friday-5-1\/","title":{"rendered":"Free-friday 5\/1"},"content":{"rendered":"\n<p>Alright, so, made some more progress with the office<br><br>Within fnaf, They have lots of gameplay systems that loop together to make the game difficult.<br>Where am I getting? simple.<br><br>After beating such a difficult night in my game, you now have a victory screen.<br><br>The 6 am win screen<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pygame\n\nclass WinScreen:\n    def __init__(self):\n        self.font_big = pygame.font.Font(None, 120)\n        self.font_small = pygame.font.Font(None, 60)\n\n        self.text = self.font_big.render(\"6 AM\", True, (255, 255, 255))\n        self.text_rect = self.text.get_rect(center=(400, 300))\n\n        self.subtext = self.font_small.render(\"Night Complete\", True, (255, 255, 255))\n        self.subtext_rect = self.subtext.get_rect(center=(400, 420))\n\n        # Fade-in overlay\n        self.alpha = 255\n        self.fade_speed = 2\n\n        self.black = pygame.Surface((800, 800))\n        self.black.fill((0, 0, 0))\n\n    def handle_events(self, events):\n        # Click to return to title screen\n        from scenes.title import TitleScreen\n\n        for e in events:\n            if e.type == pygame.MOUSEBUTTONDOWN:\n                return TitleScreen()\n\n    def update(self, dt):\n        if self.alpha > 0:\n            self.alpha -= self.fade_speed\n            if self.alpha &lt; 0:\n                self.alpha = 0\n\n    def draw(self, screen):\n        screen.fill((0, 0, 0))\n        screen.blit(self.text, self.text_rect)\n        screen.blit(self.subtext, self.subtext_rect)\n\n        if self.alpha > 0:\n            self.black.set_alpha(self.alpha)\n            screen.blit(self.black, (0, 0))\n<\/code><\/pre>\n\n\n\n<p>With this large block of code, (Which only took me 30-25 mins), i made a victory screen for beating the night, and made it a gameplay loop for the future.<br><br>It was difficult trying to figure out how to get it to loop in the first place, but with these time fructions, and setting requirements for when the victory screen can be visible, it works perfectly fine.<br><br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> from win_screen import WinScreen\n\n        if self.timer.reached_6am():\n            return WinScreen()<\/code><\/pre>\n\n\n\n<p>Next time I work on this, I plan to add a power system to this game, so that way the player needs to manage power whilst dealing with the threats heading their way.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alright, so, made some more progress with the office Within fnaf, They have lots of gameplay systems that loop together [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/posts\/55\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/e_henderson\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}