Introduction
what? Become a single dog and become a leftover egg?! It doesn't matter. Today Muzi only used one move to get you off the order quickly!
As the saying goes: all love without gifts is playing hooligans! But what gift to give is a great test of a person's IQ, EQ
FGHJKLMNOPQ, especially in the face of girls, what gifts are you going to give for Christmas?
Send flowers 🌹? Send apples 🍎? Send chocolate 🥮? Eat Christmas dinner 🍱?
Stereotyped, how can people see your sincerity! Let's see how programmers spend Christmas!
Christmas - Love - Romance - Beauty - is to spoil you
Mumuzi turns into Santa Claus and begins to distribute Christmas gift bags: please accept the love given to you!👇
Text
This paper is mainly a drawing applet based on Turtle. (including multiple source code drops) it's super nice~
I 🎄 Lovely Christmas Eve circle of friends copy
❶🦌•┈ ✨ ┈ 🌟┈🎄┈🌟┈✨┈•🦌
Hang the elk on the Christmas tree and you in my heart ✨
❷ 🎄ᎷᎬٗᎡ͙ᎡᎽ✦🎅 ྀིCᎻᏒᎥٗᏚᎢ͙ᎷᎪᏚ🎄
❸ 🍎 It may be my greatest wish to receive an apple from you
❹ turn over your socks and hang them inside out. The whole world is my gift. Hey, hey, I can be a little clever 🥳
❺ 💍 Merry Christmas is not as good as Mary me *
❻ you turn on the front camera, see? It's my most wanted Christmas present ✨
2, Christmas tree on a snowy night
snowflake ❄ All the time, of course, there is background music~
1) Effect display
2) Code demonstration
<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f8f8f8"># Initialize pygame pygame.init() #Set the screen width and height, and adjust according to the background image bg_img = "bg.png" bg_size = (609, 601) screen = pygame.display.set_mode(bg_size) pygame.display.set_caption("Christmas tree on a snowy night") bg = pygame.image.load(bg_img) # Snowflake list snow_list = [] for i in range(150): x_site = random.randrange(0, bg_size[0]) # Snowflake center position y_site = random.randrange(0, bg_size[1]) # Snowflake center position X_shift = random.randint(-1, 1) # x-axis offset radius = random.randint(4, 6) # Radius and y-cycle descent snow_list.append([x_site, y_site, X_shift, radius]) # Create clock object clock = pygame.time.Clock() # Add music track = pygame.mixer.music.load('my.mp3') # Load music file pygame.mixer.music.play() # Play music stream pygame.mixer.music.fadeout(600000) # Set music end time done = False while not done: # Message event loop, judge exit for event in pygame.event.get(): if event.type == pygame.QUIT: done = True screen.blit(bg, (0, 0)) # Snowflake list loop for i in range(len(snow_list)): # Draw snowflakes, color, position and size pygame.draw.circle(screen, (255, 255, 255), snow_list[i][:2], snow_list[i][3] - 3) # Move snowflake position (next cycle takes effect) snow_list[i][0] += snow_list[i][2] snow_list[i][1] += snow_list[i][3] # If snowflakes fall off the screen, reset the position if snow_list[i][1] > bg_size[1]: snow_list[i][1] = random.randrange(-50, -10) snow_list[i][0] = random.randrange(0, bg_size[0]) # Refresh screen pygame.display.flip() clock.tick(30)</span></span></span>
3, The 🎄 Lovely Christmas Eve circle of friends copy
❼🔔 ྀི♡ >> ♥️♥️♥️
If you are put in a sack on Christmas day, please don't be afraid, because the Christmas gift I want is you.
❽ 🔔 I'm ling'er
🌲 You are jingle because Ling Er wants to jingle • • •
❾ I'm cute. How about making your Christmas present
❶⓪ if I ask Santa for you, will he give it ★
IV. ℳ ᴇ ʀʀ Ꮍ 🎅 ྀིℂ ʜʀɪ sᴛᴍᴀs
1) Effect display
2) Code demonstration
<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f8f8f8">import turtle as t from turtle import * import random as r import time n = 100.0 speed("fastest") screensize(bg='black') left(90) forward(3*n) color("orange", "yellow") begin_fill() left(126) for i in range(5): forward(n/5) right(144) forward(n/5) left(72) end_fill() right(126) def drawlight(): if r.randint(0, 30) == 0: color('tomato') circle(6) elif r.randint(0,30) == 1: color('orange') circle(3) else: color('dark green') color("dark green") backward(n*4.8) def tree(d, s): if d <= 0: return forward(s) tree(d-1, s*.8) right(120) tree(d-3, s*.5) drawlight()#Draw small colored lights at the same time right(120) tree(d-3, s*.5) right(120) backward(s) tree(15, n) backward(n/2) for i in range(200): a = 200 - 400 * r.random() b = 10 - 20 * r.random() up() forward(b) left(90) forward(a) down() if r.randint(0, 1) == 0: color('tomato') else: color('wheat') circle(2) up() backward(a) right(90) backward(b) t.color("dark red","red") t.write("Merry Christmas",align ="center",font=("Comic Sans MS",40,"bold"))#write def drawsnow(): t.ht() #Hide pen head, ht=hideturtle t.pensize(2) #Define pen size for i in range(200): #How many snowflakes do you draw t.pencolor("white") #Defining the brush color as white actually means that snowflakes are white t.pu() #Pen lifting, pu=penup t.setx(r.randint(-350,350)) #Define the x coordinate and randomly select from - 350 to 350 t.sety(r.randint(-100,350)) #Define the y coordinate. Note that snowflakes generally do not fall on the ground, so they do not start from the too small longitudinal seat axis t.pd() #Write, pd=pendown dens = 6 #The number of snowflakes is set to 6 snowsize = r.randint(1,10) #Define snowflake size for j in range(dens): #That's 6, that's 5 times, that's a snowflake five pointed star #t.forward(int(snowsize)) #int() takes an integer t.fd(int(snowsize)) t.backward(int(snowsize)) #t.bd(int(snowsize)) #Note that there is no bd=backward, but there is fd=forward, a small bug t.right(int(360/dens)) #Rotation angle </span></span></span>
5, The 🎄 Lovely Christmas Eve circle of friends copy
❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶❶101 🧐
❶ there is no Santa Claus in the world. All gifts and surprises come from people who love you
❶ ❸ although there is no Santa Claus in the world who will sneak gifts into your socks when you sleep, there will always love you
People prepare small surprises for you on special days ✨
❶❹ 🔔 🍎 🎊 ℳᴇʀʀᎽ🎅 ྀིℂʜʀɪsᴛᴍᴀs🎄🍬
❶❺🍎 🛎🎈❄️ ♥️ 🍏
I hope the Christmas tree / gift / snowflake will come with you ✨ Christmas in 2021 🎄
6, Christmas gifts 🎅
Source code too much, private letter me ha!
summary
Finally, I wish you an early Christmas! Source code didi I can!
💦 Free source code collection: Didi, I can~
Or take it from my home page (pc side)!
Your support is my biggest motivation!! Remember the third consecutive oh ~mua# welcome to read the previous articles~
💨 Previous game reading recommendations——
Item 10.2: Brick playing games
Program O takes you to recall the classic: developing a brick playing game with native Python~
Item 10.1 squid game: 123 wooden man
When "squid game" came: "one, two, three, wooden man, Smecta." Are you still scared?
Project 1.0 # super Mary
Programmer homemade game: Super Mary 100% real version, which can make you cry ~ [with source code]
Item 1.1 mine clearance
🍓 Article summary——
(more content + source code are summarized in the article!! welcome to read ~)
- MERRY CHRISTMAS -
Merry Christmas