Go to file
Valentin Valls b86038301b
Extend world generation (#51)
* Rework the texture mapping to use human logical indexes (top-down)

* Use a bigger texture

* Add stone blocks with ore

* Rework the generator to also split sectors vertically

* Create a noise module to handle octaves

* Use the new noise class

* Generate underground

* Make the code independant from the size of the section

* Speed up sectorize

* Create a world module for world model and sector

* Use the default world queue to register new sectors

* At start put the player on the summit

* Collide the player with the enclosure

* Add a get_focus_block

* Set sector size to 8

* Improve the world structure for dense maps

* Speed up exposed method

* Tune the visibility distance

* Create a single vertex list per section

* Use constances
2020-05-25 08:53:04 +09:00
assets Extend world generation (#51) 2020-05-25 08:53:04 +09:00
game Extend world generation (#51) 2020-05-25 08:53:04 +09:00
libs Add perlin noise library for use with genworld module. 2020-05-21 17:04:00 +09:00
.gitignore Untracked .vscode and .idea folders, and updated .gitignore. 2018-04-13 14:21:11 +09:00
LICENSE Initial commit 2018-03-30 10:32:33 +02:00
README.md Update README.md 2019-04-19 12:53:43 +02:00
main.py Extend world generation (#50) 2020-05-21 16:57:25 +09:00
setup.py update headers + game options title 2019-04-23 18:04:32 +02:00

README.md



made-with-python Maintenance GPLv3 license


Goals and Vision

TerraCraft is a small SandBox game engine written in Python 3 + Pyglet.

The objectives of this project are as follows:

  • The intention is to create a small complete game focused exclusively on creative mode.

  • The project must remain simple, well documented (code and wiki) and easy to modify / improve for students and hobbyists. Keeping the code ordered is very important.

  • I would like to see this project turn into an educational tool. Kids love Minecraft and Python is a great first language.

  • This is a good opportunity to entertain children on programming.

  • We are writing a new wiki to help users collaborate on the project in an easy and productive way. If you have questions, suggestions or want to help us, please write to xenonlab.develop@gmail.com or open a discussion here on Github in the "Issues" section.

The code should be well commented and more easily configurable. It should be easy to make some simple changes and see the results quickly.

Thank you all.

🎯 Goals to achieve:


  • Keep the code ordered, and well commented! realize documentation that is a step by step process for the long-term development of the project. Keep the project easy to understand and simple to change. The wiki is undergoing constant improvement, and will always be updated and improved over time.
  • 💾 Project optimization and reorganization.
  • 🎃 Create dedicated and exclusive textures for TerraCraft.
  • 🎮 A new inventory system, which can be recalled with the "I" key and a configurable hotbar (from a minimum of 8 to a maximum of 15 frames). The current inventory system allows you to select blocks using the keyboard keys 1 to 0, without displaying the active block. Removing the limit of only 10 blocks is one of the priorities of the project.
  • 👾 Improvement of the map generation system, with the possibility of generating the terrain with the Perlin algorithm or a completely flat map. The choice can be made via the game menu when the New World button is activated.
  • 💡 Making a menu at the start of the game, similar to that of Minecraft but with a personal and easily customizable gui.
  • 🎼 Add sound effects and music that can be adjusted and deactivated in game (and from the options menu).

How to Run

sudo pip3 install pyglet
git clone https://github.com/XenonLab-Studio/TerraCraft.git
cd TerraCraft
python3 main.py

Mac

On Mac OS X, you may have an issue with running Pyglet in 64-bit mode. Try running Python in 32-bit mode first:

arch -i386 python3 main.py

If that doesn't work, set Python to run in 32-bit mode by default:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes 

This assumes you are using the OS X default Python. Works on Lion 10.7 with the default Python 3.5+, and may work on other versions too. Please raise an issue if not.

See the wiki for this project to install Python, and other tips.

Controls:

Moving

  • W: forward
  • S: back
  • A: strafe left
  • D: strafe right
  • Mouse: look around
  • Space: jump + vertical flying up
  • Tab: toggle flying mode
  • Left-Shift: vertical flying down
  • Left-Ctrl: run
  • ESC: release mouse, then close window

Building

  • Selecting type of block to create:
    • 1: Dirt
    • 2: Dirt_with_Grass
    • 3: Sand
    • 4: Snow
    • 5: Cobblestone
    • 6: Brick_Cobblestone
    • 7: Brick
    • 8: Tree
    • 9: Leaves
    • 0: Wooden_Planks
    • Mouse left-click: remove block
    • Mouse right-click: create block

Warning! By pressing F12, the previous screenshot is automatically overwritten.

Quitting

  • ESC: release mouse, then close window

License

Copyright (C) 2013 Michael Fogleman
Copyright (C) 2018-2019 Stefano Peris

eMail: xenonlab.develop@gmail.com
Github repository: https://github.com/XenonLab-Studio/TerraCraft

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

This software is licensed under the GPL3 license.

Find a copy of the full license within this project (LICENSE).