Closed joyhyunki closed 1 year ago
This issue tracker is for bugs in this repo. Please ask questions like yours on my Discord server or on YouTube directly :)
That being said, obvious question, have you tried running/comparing the code in this repo?
My mistake :( Apologies for posting my question here. I did compare it with the code here, and still, it did not work.
Does the code here run at least? Do note that, because Python is a bit slow, you should expect to wait a few seconds for things to load - it's not normal if it takes like more than 10 seconds though
Whoa it suddenly worked. I guess it was because of a slow computer that I was using. Thank you for answering :) 👍 I'll close this issue. I am sorry for posting here. I still have a few problems with my original chunk generation but I finished the code and it works.
No worries and glad it's working for you now :)
Working on episode 8, and the chunks don't load. All I see is a big black screen. Here is all the main.py and chunks.py file (the reason I named the file chunks is that there is some module named chunks. So main.py thinks I'm loading the module, not the file.) Also, I think there is a problem in the world.py file...
This is main.py. It is before coding the world, where I am currently coding.
'import math import ctypes import pyglet
pyglet.options["shadow_window"] = False pyglet.options["debug_gl"] = False
import pyglet.gl as gl
import matrix import shader import camera
import block_type import texture_manager
import chunks
class Window(pyglet.window.Window): def init(self, args): super().init(args)
class Game: def init(self): self.config = gl.Config(double_buffer = True, major_version = 3, minor_version = 3, depth_size = 16) self.window = Window(config = self.config, width = 800, height = 600, caption = "Minecraft clone", resizable = True, vsync = False)
if name == "main": game = Game() game.run()`
And this is chunks.py file. `import ctypes
import pyglet.gl as gl
CHUNK_WIDTH = 16 CHUNK_HEIGHT = 16 CHUNK_LENGTH = 16
class Chunk: def init(self, chunk_position): self.chunk_position = chunk_position
And I also attached camera.py just in case. `import math import matrix
class Camera: def init(self, shader, width, height): self.width = width self.height = height
This is all the files I have trouble with while loading the basic 16 x 16 x 16 chunk. Also there is a problem in world.py file. I'll just attach a part of your source code here where problem occurs.
` self.block_types = [None] # "None" is the block type for air
I get the following error message from VS Code. """ Argument of type "Block_type" cannot be assigned to parameter "__object" of type "None" in function "append" Type cannot be assigned to type "None"Pylance[reportGeneralTypeIssues] (https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues) class Block_type( texture_manager: Texture_manager, name: str = "unknown", block_face_textures: Unknown = { "all": "cobblestone" } ) """
Please, help me! Removing the whole chunks.py and world.py and re-coding this for the 4th time.