Skip to content

Block Types

Jon R edited this page Jul 7, 2016 · 2 revisions

There are almost an infinite amount of block types that can be in the game and because of this we need a way to keep track of them. That is what the BlockType enum takes care of. The enum holds all of the block types that are in the game and distinguishes them by an ID value. When defining a new type you need to set the ID of that type in it's constructor. It's important not to use the same ID as another block otherwise the game will not know how to distinguish between them. You can see examples of this by looking at the already existing block types in the enum.

The enum offers a single static method that will return a BlockType by the ID given in the parameter of the method. You will see BlockType used through the project and you will learn how and where to use it in the coming sections.

Overview
The World
        Blocks
        Block Types
        Block Manager
        Block Properties
        Walls
        Chunks
        Chunk Generation
        The Chunk Manager
        Lighting
        The Physics Engine
        Entities
        The World
        World I/O

Items
        Items & Item Categories
        Item Types
        Item Stacks
        Item Manager
        Inventories
        Crafting

User Interfaces
        The Screen System
        Interface Components
        The Game HUD

Utilities
        The Thread Manager
        Factories & Caches

Clone this wiki locally