简体   繁体   English

Pygame:如何对另一个图像之后的图像进行模糊处理

[英]Pygame: how to blit an image that follows another image

I'm trying reproduce the game "Snake" in pygame, using the pygame.blit function, instead of pygame.draw. 我正在尝试使用pygame.blit函数而不是pygame.draw在pygame中重现游戏“ Snake”。 My question is how to make an image follow another image. 我的问题是如何使图像跟随另一个图像。 I mean, make the snake's body photo follow your head. 我的意思是,使蛇的身体照片跟随您的头部。 In the current state of my program the head moves on its own. 在我程序的当前状态下,磁头会自行移动。

Keep positions of snake segments on list (first segment is head). 将蛇形段的位置保持在列表上(第一个段为头)。

Later new position of head insert before first segment (and remove last segment). 头部插入物的后来新位置在第一个片段之前(并移除最后一个片段)。

Use this list to blit snake segments. 使用此列表可以使蛇段弯曲。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM