{"id":102,"date":"2024-04-12T14:06:01","date_gmt":"2024-04-12T14:06:01","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_carpenter\/?p=102"},"modified":"2024-04-12T14:06:01","modified_gmt":"2024-04-12T14:06:01","slug":"free-friday-and-screw-michael","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_carpenter\/2024\/04\/12\/free-friday-and-screw-michael\/","title":{"rendered":"Free Friday and Screw Michael"},"content":{"rendered":"\n<p><strong>I worked on making a button but it doesn&#8217;t work yet.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pygame.font\n\nclass Button:\n    def __init__(self,ai_game, msg):\n        self.screen = ai_game.screen\n        self.screen_rect = self.screen.get_rect()\n\n        self.width, self.height = 200, 50\n        self.button_color = (0, 255, 0)\n        self.text_color = (255, 255, 255)\n        self.font = pygame.font.SysFont(None, 48)\n        \n        self.rect = pygame.Rect(0,0, self.width, self.height)\n        self.rect.center = self.screen_rect.center\n\n        self._prep_msg(msg)\n\n    def _prep_msg(self, msg):\n        self.msg_image = self.font.render(msg, True, self.text_color, self.button_color)\n        self.msg_image_rect = self.msg_image.get_rect()\n        self.msg_image_rect.center = self.rect.center\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I worked on making a button but it doesn&#8217;t work yet.<\/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-102","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts\/102\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}