{"id":86,"date":"2026-04-10T14:15:38","date_gmt":"2026-04-10T14:15:38","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/r_najim\/?p=86"},"modified":"2026-04-10T14:15:38","modified_gmt":"2026-04-10T14:15:38","slug":"friday-april-10-2026","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/r_najim\/2026\/04\/10\/friday-april-10-2026\/","title":{"rendered":"Friday April 10, 2026"},"content":{"rendered":"\n<p><strong>This Free Friday I am working on a project on YouTube a Snake Game.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=QFvqStqPCRU\">https:\/\/www.youtube.com\/watch?v=QFvqStqPCRU<\/a><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>import pygame, sys\n\npygame.init()\ncell_size = 40\ncell_number = 20\nscreen = pygame.display.set_mode((cell_number * cell_size,cell_number * cell_size))\nclock = pygame.time.Clock()\nwhile True:\n    for event in pygame.event.get():\n        if event.type == pygame.QuIT:\n            pygame.quit()\n            sys.exit()\n\n    screen.fill((175,215,70))\n    pygame.display.update()\n    clock.tick(60)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>This part of code is for to display the screen for the Snake Game.<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>class FRUIT:\n  def _init_(self):\n        self.x = random.randint(0,cell_number - 1)\n        self.y = random.randint(10,cell_number - 1)\n        self.pos = Vector2(self.x,self.y)\n\n  def draw_fruit(self):\n      fruit_rect = pygame.Rect(int(self.pos.x * cell_size),int(self.pos.y * cell_size),cell_size,cell_size)\n      pygame.draw.rect(screen,(126,166,114),fruit_rect)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>This part of the code is the fruit in the Snake game.<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>class SNAKE:\n    def _init_(self):\n        self.body = &#91;Vector2(5,10), Vector2(6,10), Vector2(7,10)]\n\n    def draw_snake(self):\n        for block in self.body:\n            x_pos -=int(block.x * cell_size)\n            y_pos -= int(block.y * cell_size)\n            block_rect = pygame.rect(x_pos,y_pos,cell_size,cell_size)\n            pygame.draw.rect(screen,(183,191,122),block_rect)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>This part of the code is the Snake in the Snake game.<\/strong><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Free Friday I am working on a project on YouTube a Snake Game.<\/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-86","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":87,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/posts\/86\/revisions\/87"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/r_najim\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}