GithubHelp home page GithubHelp logo

minecraft's People

Contributors

stanislavpetrovv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

minecraft's Issues

glm.vec2 & glm.vec3 do not work, from both my own code and complete copy paste from source code.

Error

"C:\Users\#\Game Development\Hellow3DWorld\venv\Scripts\python.exe" "C:\Users\#\Game Development\Hellow3DWorld\h3Dw\main.py" 
Traceback (most recent call last):
  File "C:\Users\echol\Game Development\Hellow3DWorld\h3Dw\main.py", line 1, in <module>
    from settings import *
  File "C:\Users\echol\Game Development\Hellow3DWorld\h3Dw\settings.py", line 7, in <module>
    WIN_RES = glm.vec2(1600, 900)
              ^^^^^^^^
AttributeError: module 'glm' has no attribute 'vec2'

Process finished with exit code 1

settings.py:

from numba import njit
import numpy as np
import glm
import math

# resolution
WIN_RES = glm.vec2(1600, 900)

# colors
BG_COLOR = glm.vec3(0.1, 0.16, 0.25)

main.py:

from settings import *
import moderngl as mgl
import pygame as pg
import sys


class VoxelEngine:
    def __init__(self):
        pg.init()
        pg.display.gl_set_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3)
        pg.display.gl_set_attribute(pg.GL_CONTEXT_MINOR_VERSION, 3)
        pg.display.gl_set_attribute(pg.GL_CONTEXT_PROFILE_MASK, pg.GL_CONTEXT_PROFILE_CORE)
        pg.display.gl_set_attribute(pg.GL_DEPTH_SIZE, 24)

        pg.display.set_mode(WIN_RES, flags=pg.OPENGL | pg.DOUBLEBUF)
        self.ctx = mgl.create_context()

        self.ctx.enable(flags=mgl.DEPTH_TEST | mgl.CULL_FACE | mgl.BLEND)
        self.ctx.gc_mode = 'auto'

        self.clock = pg.time.Clock()
        self.delta_time = 0
        self.time = 0

        self.is_running = True

    def update(self):
        self.delta_time = self.clock.tick()
        self.time = pg.time.get_ticks() * 0.001
        pg.display.set_caption(f'{self.clock.get_fps() :.0f}')

    def render(self):
        self.ctx.clear(color=BG_COLOR)
        pg.display.flip()

    def handle_events(self):
        for event in pg.event.get():
            if event.type == pg.QUIT or (event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE):
                self.is_running = False

    def run(self):
        while self.is_running:
            self.handle_events()
            self.update()
            self.render()
        pg.quit()
        sys.exit()


if __name__ == '__main__':
    app = VoxelEngine()
    app.run()

I have all of the requirements but im still getting an error

I have all of the packages including opensimplex and they are all upgraded to or higher than the requirements i read in the requirements.txt file but i still get this error: ValueError: Requested OpenGL version 330, got version 310
Here is my code so far:
main.py:
from settings import *
import moderngl as mgl
import pygame as pg
import sys

class VoxelEngine:
def init(self):
pg.init()
pg.display.gl_set_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3)
pg.display.gl_set_attribute(pg.GL_CONTEXT_MAJOR_VERSION, 3)
pg.display.gl_set_attribute(pg.GL_CONTEXT_PROFILE_MASK, pg.GL_CONTEXT_PROFILE_CORE)
pg.display.gl_set_attribute(pg.GL_DEPTH_SIZE, 24)

    pg.display.set_mode(WIN_RES, flags=pg.OPENGL | pg.DOUBLEBUF)
    self.ctx = mgl.create_context()

    self.ctx.enable(flags=mgl.DEPTH_TEST | mgl.CULL_FACE | mgl.BLEND)
    self.ctx.gc_mode = 'auto'

    self.clock = pg.time.Clock()
    self.delta_time = 0
    self.time = 0

    self.is_running = True

def update(self):
    self.delta_time = self.clock.tick()
    self.time = pg.time.get_ticks() * 0.001
    pg.display.set_caption(f'{self.clock.get_fps() :.0f}')

def render(self):
    self.ctx.clear()
    pg.display.flip()

def handle_events(self):
    for event in pg.event.get():
        if event.type == pg.QUIT or (event.type == pg.KEYDOWN and event.key == pg.K_ESCAPE):
            self.is_running = False

def run(self):
    while self.is_running:
        self.handle_events()
        self.update()
        self.render()
    pg.quit()
    sys.exit()

if name == 'main':
app = VoxelEngine()
app.run()

settings:
from numba import njit
import numpy as np
import glm
import math

WIN_RES = glm.vec2(1600,900)

Fix for `requriments.txt` and please add LICENSE.

Introduction

The current requriments.txt is invalid. The normal opensimplex module does not work with Numba. Installing opensimplex[numpy] would fix all problems. Also having the dependencies without their version would have a possibility of incompatible modules being installed and thus the error ...

$ python main.py
pygame 2.1.2 (SDL 2.0.18, Python 3.10.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe

requriments.txt fix

pygame==2.5.0
moderngl==5.8.2
numba==0.57.1
PyGLM==2.7.0
numpy<1.25,>=1.21
opensimplex[numpy]==0.4.4

LICENSE please

Also I recommend adding a LICENSE file, this tell people what they cant and can do with your code. Currently they are legally not allowed to do anything, so following your video and copying the code would be breaking the law (even if you want them to do so). https://choosealicense.com/ can help you to choose a LICENSE that you want. It is best practice to put a file called LICENSE inside the repository root. Then GitHub will parse the file and label the repository appropriately.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.