自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (2)
  • 收藏
  • 关注

原创 我的世界—Python(八)

self.model.process_queue() sector = sectorize(self.position) if sector != self.sector: self.model.change_sectors(self.sector, sector) if self.sector is None: self.model.process_entire_queue()

2022-04-20 19:11:57 239 1

原创 我的世界—Python(七)

# Current (x, y, z) position in the world, specified with floats. Note # that, perhaps unlike in math class, the y-axis is the vertical axis. self.position = (0, 0, 0) # First element is rotation of the player in the x-z p

2022-04-20 19:05:47 78

原创 我的世界—Python(六)

def change_sectors(self, before, after): """ Move from sector `before` to sector `after`. A sector is a contiguous x, y sub-region of world. Sectors are used to speed up world rendering. """ before_set = set()

2022-04-20 19:01:00 235

原创 我的世界—Python(五)

texture = self.world[position] self.shown[position] = texture if immediate: self._show_block(position, texture) else: self._enqueue(self._show_block, position, texture) def _show_block(self, posi

2022-04-20 18:58:00 272

原创 我的世界—Python(四)

""" x, y, z = position for dx, dy, dz in FACES: if (x + dx, y + dy, z + dz) not in self.world: return True return False def add_block(self, position, texture, immediate=True): """ Add

2022-04-20 18:52:44 202

原创 我的世界—Python(三)

class Model(object): def __init__(self): # A Batch is a collection of vertex lists for batched rendering. self.batch = pyglet.graphics.Batch() # A TextureGroup manages an OpenGL texture. self.group = TextureGroup(imag

2022-04-20 18:49:02 249

原创 我的世界—Python(二)

TEXTURE_PATH = 'texture.png'GRASS = tex_coords((1, 0), (0, 1), (0, 0))SAND = tex_coords((1, 1), (1, 1), (1, 1))BRICK = tex_coords((2, 0), (2, 0), (2, 0))WOOD = tex_coords((1, 2), (1, 2), (1, 2))STONE = tex_coords((2, 1), (2, 1), (2, 1))ABC = tex_coo

2022-04-20 18:44:32 117

原创 我的世界—Python(一)

from __future__ import divisionimport sysimport mathimport randomimport timefrom collections import dequefrom pyglet import imagefrom pyglet.gl import *from pyglet.graphics import TextureGroupfrom pyglet.window import key, mouseTICKS_PER_SEC =

2022-04-20 17:51:59 300

原创 基础的数字类型(下)

大家好,我是会开灰机的小张!求关基的数字类型↓#比较两个数的大小a3 = 6a4 = 9print((a3>a4)-(a3<a4))#max 去比较的数的最高值print(max(a3,a4))#求x的y次方 2的5次方#pow 计算次方print(pow(2,5))#round (x[.n])返回浮点数x的四舍五入的值,如果给出n值,则代表舍入到小数点后n位print(round(3.456))print(round(3.546, 1))print(round(3.556))

2022-04-20 12:40:00 50

原创 基础数字类型(上)

你我皆MC,身在方块中!我是会开灰机的小张这是基础数字类型↓#导入库#库:封装一些功能#math:数学相关的库#random:生成随机数import randomimport math'''分类:整数、浮点数、复数''''''整数:Python可以处理任意大小的整数,当然包括负整数,在程序中的表示和数学的写法一样。'''#连续定义多个变量num1 = num2 = num3 = 3print(num1 , num2 , num3)#交互式赋值...

2022-04-20 12:31:01 191

原创 pygame下载 + 安装 + 为什么安装时会报错解答

如何安装pygame:先下载pygame:一键到达pygame下载区(不要别的,只要一个赞和关注)用 window + R 打开菜单,输入cmd,点击确定,就会有一个黑色的命令窗口出现,输入pip install pygame,如果是苹果电脑,输入pip3 install pygame,回车。如果出现进度条,即为开始安装。如果进度条突然停止,那就重新输入。为什么安装pygame时报错:有人安装pygame时程序报错,这是为什么呢???报错可能是因为:No.1 python版本安.

2022-04-19 17:02:58 8221 2

俄罗斯方块—Python

代码有缺请关注截图私信

2022-04-20

坦克大战2D--Python

如有缺请关注后截图私信 代码有详细注释,非常容易理解代码 坦克大战用的是pygame模块写出来的,打开界面是游戏菜单,有单人和双人模式(play and plays) 效果 介绍:点击开始,会出现好几辆坦克,可以操控的那辆坦克便是我方的,用砖块围起来的一个鹰的图案是大本营,只要受到攻击,就Gameover了 那怎样才能让大本营变得抗揍呢??? 游戏开始过个几分钟,只要你没Gameover,地图上就会有铲子出现,只要操控坦克碰到它,大本营就会升为银砖(原本是普通砖头) 那手枪是啥?? 只要你玩了几分钟,而且没死,就会看到一把手枪。捡起它,可以让玩家操纵的坦克发出的炮弹效果增加(不是特别明显) 这就是坦克大战的部分规则,其他的可以自己摸索(懒得放上规则) 喜欢的朋友请多多支持

2022-04-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除