Code Monkey home page Code Monkey logo

python's People

Contributors

redhendev avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

python's Issues

PyCraft_tut_7 terrain generation is kinda glitched......

image
Hey, (umm idk ur name).... @RedHenDev

Can you tell what's happening?
I tried to code it myself i got the same output. So I decided to use you code and ....... you guessed it , same glitched terrain.
I just downloaded the whole repo and executed it just like that, without even touching the code.

Btw its me whose pronounciation you had nailed... Anushtubh

Umm, so what now? @RedHenDev

Update on Terrain Generation in PyCraft

Ok, so as you said in the last issue, I did apply the new model and texture everywhere i went in the code.:sweat_smile:
But, after the blocks combine into a megaset, the the texture is no longer there. Now, for the first time ever i found a solution. ๐Ÿ˜†. So wherever I saw a model without the block in it, I replaced it with block and replaced the texture to block_texture.
But still the issue wasnt resolved but i found the solution in this if statement. on line 183
So here it is @RedHenDev :
When we combine the megsets,
if subDic.get('x'+str(x)+'z'+str(z))!='i': subCubes[currentCube].enable() subCubes[currentCube].x = x subCubes[currentCube].z = z subDic['x'+str(x)+'z'+str(z)] = 'i' subCubes[currentCube].parent = subsets[currentSubset] y = subCubes[currentCube].y = genPerlin(x,z) g = nMap(y,-8,21,12,243) g += random.randint(-12,12) subCubes[currentCube].color = color.rgb(0,g,0) subCubes[currentCube].disable() currentCube+=1
In the last part, I added : subCubes[currentCube].model = 'block' subCubes[currentCube].texture = 'block_texture'
(Sorry its not indented or placed underneath eachother or something)

So Before Combine (old code)-
before_combine1
After Combine - (old code)-
after_combine1
look at the texture persistnce.....

Now Before Combine(my new code)-
before_combine2
After Combine Megasets(new code)-
after_combine2

Now look at the Texture persistence...
You can also change it in the repo, Just search for 'model' and change it to 'block' and search 'texture' to 'block_texture'

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.