Edited code
This commit is contained in:
@@ -3,30 +3,16 @@ import turtle
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
# === SETUP THE GAME WINDOW ===
|
# === SETUP THE GAME WINDOW ===
|
||||||
screen = turtle.Screen()
|
|
||||||
screen.setup(600, 600)
|
|
||||||
screen.bgcolor("black")
|
|
||||||
screen.title("Asteroid Game")
|
|
||||||
screen.tracer(0) # Turn off auto-update for smooth animation
|
|
||||||
|
|
||||||
# === CREATE PLAYER ===
|
# === CREATE PLAYER ===
|
||||||
player = turtle.Turtle()
|
|
||||||
player.hideturtle() # Hide the turtle shape
|
|
||||||
player.color("#00FFFF") # Cyan color
|
|
||||||
player.penup()
|
|
||||||
player.goto(0, -250)
|
|
||||||
player.emoji = "🛰️" # Satellite emoji
|
|
||||||
player_speed = 20
|
|
||||||
|
|
||||||
# === GAME VARIABLES ===
|
# === GAME VARIABLES ===
|
||||||
game_active = True
|
|
||||||
asteroids = [] # List to store all asteroids
|
|
||||||
|
|
||||||
# === FUNCTIONS ===
|
# === FUNCTIONS ===
|
||||||
def draw_player():
|
|
||||||
"""Draw the player satellite"""
|
|
||||||
player.clear()
|
|
||||||
player.write(player.emoji, align="center", font=("Arial", 32, "normal"))
|
|
||||||
|
|
||||||
# === TEST CODE ===
|
# === TEST CODE ===
|
||||||
# Uncomment this to test:
|
# Uncomment this to test:
|
||||||
|
|||||||
Reference in New Issue
Block a user