falldown.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Playing-Falldown-with-a-DQN 作者: HarrySonghurst 项目源码 文件源码
def format_surface_render(self, surface):
        resized_surface = pygame.transform.smoothscale(pygame.PixelArray(surface).make_surface(), (52, 68))  # (W, H)
        formatted_array = np.zeros((68, 52), dtype="uint8")
        for i in range(68):
            for j in range(52):
                red, green, blue, alpha = resized_surface.get_at((j, i))  # (x, y)
                formatted_array[i, j] = int((red + green + blue) / 3)
        return formatted_array
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号