added wall and roof class
This commit is contained in:
parent
b5364993aa
commit
502d501628
29
wall.py
Normal file
29
wall.py
Normal file
@ -0,0 +1,29 @@
|
||||
from pyblockworld import World
|
||||
|
||||
class Wall:
|
||||
__length:int
|
||||
__width:int
|
||||
__height:int
|
||||
__rotated:bool
|
||||
__x:float
|
||||
__y:float
|
||||
__z:float
|
||||
__world:World
|
||||
__block:str
|
||||
|
||||
def __init__(self, x:float, y:float, z:float, block:str, world:World, length=10, width=10, height=5, rotated=False):
|
||||
self.__width = width
|
||||
self.__length = length
|
||||
self.__height = height
|
||||
self.__x = x
|
||||
self.__y = y - 1
|
||||
self.__z = z
|
||||
self.__world = world
|
||||
self.__rotated = rotated
|
||||
self.__block = block
|
||||
|
||||
def build(self):
|
||||
if self.__rotated:
|
||||
self.__world.setBlocks(self.__x, self.__y, self.__z, self.__x + self.__width, self.__y + self.__height, self.__z, self.__block)
|
||||
else:
|
||||
self.__world.setBlocks(self.__x, self.__y, self.__z, self.__x, self.__y + self.__height, self.__z + self.__length, self.__block)
|
Loading…
x
Reference in New Issue
Block a user