{"id":180,"date":"2026-05-08T15:20:34","date_gmt":"2026-05-08T15:20:34","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/d_eanes\/?p=180"},"modified":"2026-05-08T15:20:34","modified_gmt":"2026-05-08T15:20:34","slug":"free-friday-5-8-26","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/d_eanes\/2026\/05\/08\/free-friday-5-8-26\/","title":{"rendered":"Free Friday: 5\/8\/26"},"content":{"rendered":"\n<p>Today I started building a small arcade style game using the turtle module. Right now the game includes a player ship, an enemy that moves around the screen, a missile that the player can fire, collision detection, and a border that defines the playable area.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>class Sprite<\/code><\/h3>\n\n\n\n<p>^This class is the base for every moving object in the game. It creates a turtle based sprite, sets its color and starting position, and gives it a simple movement system. It also includes boundary checks so the sprite turns when it reaches the edge of the screen. The class also provides a collision method that compares the positions of two sprites.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>class Player<\/code><\/h3>\n\n\n\n<p>^This class represents the player controlled ship. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>class Enemy<\/code><\/h3>\n\n\n\n<p>^This class creates the enemy. It inherits from Sprite and sets a faster movement speed. It also starts with a random direction so it moves unpredictably around the play area.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>class Missile<\/code><\/h3>\n\n\n\n<p>^This class represents the projectile fired by the player. It begins off screen and stays hidden until the player fires it. When fired, it moves forward in the direction the player is facing. If it leaves the playable area, it resets and becomes ready to fire again. It also checks for collisins with the enemy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>class Game<\/code><\/h3>\n\n\n\n<p>^This class stores the overall game state. It tracks the level, the score, the number of lives, and the current state of the game. It also draws the border around the play area using a turtle object. The border defines the space where all movement and collisions will take place.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>Main Game Loop<\/code><\/h3>\n\n\n\n<p>^The loop updates the player, the enemy, and the missile every frame. It checks for collisions between the player and the enemy and between the missile and the enemy. When a collision happens, the enemy is moved to a new random location. The loop continues running so the game feels active and responsive.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"949\" height=\"814\" src=\"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-08-105441.png\" alt=\"\" class=\"wp-image-181\" srcset=\"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-08-105441.png 949w, https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-08-105441-300x257.png 300w, https:\/\/theroyalscode.com\/students\/d_eanes\/wp-content\/uploads\/2026\/05\/Screenshot-2026-05-08-105441-768x659.png 768w\" sizes=\"auto, (max-width: 949px) 100vw, 949px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Today I started building a small arcade style game using the turtle module. Right now the game includes a player ship, an enemy that moves around the screen, a missile that the player can fire, collision detection, and a border that defines the playable area. class Sprite ^This class is the base for every moving&#8230;<\/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-180","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/posts\/180\/revisions\/182"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/d_eanes\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}