红衣佳人白衣友,
朝与同歌暮同酒。
世人谓我恋长安,
其实只恋长安某。

在刷抖音的时候看到了很多表白视频
类似这样的:

虽然这只是为了博人一笑,
但还是让我想到了自己青涩的初恋~脸红

我当时就是不折不扣的king of Kneel dog!
丘比特射箭的时候为什么要蒙着眼,
这个世界上重要的东西很多
世界很大相遇本不易,如果那个人是你
我愿意···
但作为那个年代的淬火钢铁直男,连“多喝热水”都不会跟妹纸说。
更别说花样表白了。
昨天正好公司的小产品说要发个这样的软件给前台妹纸,
就写一个吧送给他吧。
在文章最后,作为过来人有一段话想跟那位小产品说。

发现很多朋友想Python却不知道该怎么下手,正好我这里整理了一些关于Python的学习资料,有需要的朋友可以关注并私信我“01”获取这些学习资料,希望能对大家有所帮助!!!
教程开始
首先!
首先当然需要这两个文件,也可以换成你自己喜欢的图片和字体

sys是python的标准库,
提供了python运行时环境变量的操控sys.exit()用于结束游戏退出
import sys
import pygame
import random
游戏的高宽分别是
WIDTH, HEIGHT = 640, 360
把颜色值(230, 230, 230)赋值给 bg_color 变量
三个整数依次是三原色中红色、绿色和蓝色的浓度值。
浓度值是一个整数,最大为255,最小为0。
bg_color = (255, 255, 255)
button_text_list = [‘房产证给你’, ‘我妈会游泳’, ‘我会修电脑’, ‘我会写代码’]
(代码看不全可以左右滑动代码块,悉知)
# 点击喜欢按钮后显示的页面def show_like_interface(text, screen, color=(255, 0, 0)): screen.fill(bg_color) font = pygame.font.Font('./font/simkai.ttf', WIDTH // (len(text))) textRender = font.render(text, True, color) textRect = textRender.get_rect() textRect.midtop = (WIDTH / 2, HEIGHT / 2) screen.blit(textRender, textRect) pygame.display.update() while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit()# 按钮def button(text, x, y, w, h, color, screen): pygame.draw.rect(screen, color, (x, y, w, h)) font = pygame.font.Font('./font/simkai.ttf', 20) textRender = font.render(text, True, (0, 0, 0)) textRect = textRender.get_rect() textRect.center = ((x+w/2), (y+h/2)) screen.blit(textRender, textRect)# 标题def title(text, screen, scale, color=(0, 0, 0)): # pygame.font.Font("字体