dracula.py

Created by apocaliips

Created on October 21, 2024

2.05 KB


from kandinsky import *
from time import *

# Nuit noire
for x in range(320):
    for y in range(240):
        set_pixel(x, y, color(0, 0, 0))  # Noir nuit

# Base du château
fill_rect(50, 90, 220, 100, color(169, 169, 169))  # Gris

# Tours
fill_rect(60, 50, 30, 90, color(169, 169, 169))  # Tour gauche
fill_rect(230, 50, 30, 90, color(169, 169, 169))  # Tour droite

# Toits pointus
for x in range(60, 90):
    for y in range(30, 50):
        set_pixel(x, y, color(128, 0, 0))  # Toit gauche
        set_pixel(x + 170, y, color(128, 0, 0))  # Toit droit
for i in range(15):
    set_pixel(75 - i, 35 - i, color(128, 0, 0))  # Pointe gauche
    set_pixel(235 + i, 35 - i, color(128, 0, 0))  # Pointe droite

# Porte du château (portail ouvert)
for x in range(140, 160):
    for y in range(140, 190):
        set_pixel(x, y, color(102, 51, 0))  # Portail marron
for x in range(160, 180):
    for y in range(140, 190):
        set_pixel(x, y, color(0, 0, 0))  # Ombre du portail ouvert

# Fenêtres avec barreaux
for i in range(75, 130, 30):
    fill_rect(i, 110, 10, 20, color(0, 0, 0))  # Fenêtres
    for j in range(0, 20, 5):
        fill_rect(i+2, 110+j, 6, 1, color(169, 169, 169))  # Barreaux
for i in range(175, 230, 30):
    fill_rect(i, 110, 10, 20, color(0, 0, 0))  # Fenêtres
    for j in range(0, 20, 5):
        fill_rect(i+2, 110+j, 6, 1, color(169, 169, 169))  # Barreaux

# Chauve-souris
for i in range(5):
    set_pixel(70 + i * 20, 30 + (i % 2) * 10, color(0, 0, 0))  # Chauve-souris
    set_pixel(72 + i * 20, 32 + (i % 2) * 10, color(0, 0, 0))  # Chauve-souris
    set_pixel(74 + i * 20, 30 + (i % 2) * 10, color(0, 0, 0))  # Chauve-souris

# Arbres gris sans feuilles
for i in range(30, 290, 250):
    fill_rect(i, 110, 10, 40, color(105, 105, 105))  # Tronc gris
    fill_rect(i-5, 100, 20, 10, color(169, 169, 169))  # Branches grises

# Chemin
for x in range(140, 180, 2):
    for y in range(180, 240, 2):
        set_pixel(x, y, color(139, 69, 19))  # Chemin marron

# Lumières du château
set_pixel(160, 180, color(255, 255, 255))  # Lumière blanche

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.