A downloadable game for Windows

We all know what Minecraft looks like... or at least, I think we do?
How well do you know Minecraft?
How well do I?
Take a look and see!

Can you find the secret sponge..?

Controls:

  • WASD
  • Space: Jump
  • Shift: "Crouch"
  • Ctrl: Sprint
  • QE: Select Block
  • Alt+F4: Exit

Send me your builds in the Discord/Reddit! :D
This project was made for this video:

StatusReleased
PlatformsWindows
Rating
Rated 3.0 out of 5 stars
(1 total ratings)
Authormysticat
TagsMinecraft

Download

Download
BlockStevensonGame.zip 29 MB

Install instructions

Unzip, run .exe

Comments

Log in with itch.io to leave a comment.

(1 edit) (+1)

I like what you made but I think there's a way you can upgrade it. This would make the world generate infinitely:    

extends Node3D

# === World Settings ===

const CHUNK_SIZE = 16

const CHUNK_HEIGHT = 100

const VIEW_DISTANCE = 8  # How many chunks to load in each direction

@export var dirt_depth_base: int = 3

@export var tree_spawn_chance: float = 0.015

# === Block Types ===

const BLOCK_GRASS = 10

const BLOCK_DIRT = 8

const BLOCK_STONE = 15

const BLOCK_BEDROCK = 1

const BLOCK_LOG = 16

const BLOCK_LEAF = 12

# === Nodes ===

@onready var grid_map: GridMap = $GridMap

@onready var player: Node3D = $"../Player"

# === Data ===

var loaded_chunks: Dictionary = {}

var saved_chunks: Dictionary = {}

var last_player_chunk: Vector2i = Vector2i.ZERO

# === Noise ===

var terrain_noise = FastNoiseLite.new()

func _ready():

# Setup random seed and noise

var seed = randi()

terrain_noise.seed = seed

terrain_noise.frequency = 0.01

# Initialize the player's starting chunk

last_player_chunk = get_player_chunk()

generate_chunks_around_player(last_player_chunk)

func _process(_delta):

var current_chunk = get_player_chunk()

# If player has moved to a new chunk, generate new chunks around the new player position

if current_chunk != last_player_chunk:

last_player_chunk = current_chunk

generate_chunks_around_player(current_chunk)

unload_far_chunks(current_chunk)

# === Utility Functions ===

# Get the current chunk based on player's world position

func get_player_chunk() -> Vector2i:

return Vector2i(

int(floor(player.global_position.x / CHUNK_SIZE)),

int(floor(player.global_position.z / CHUNK_SIZE))

)

# Generate chunks in a square around the player (VIEW_DISTANCE)

func generate_chunks_around_player(center_chunk: Vector2i):

for x_off in range(-VIEW_DISTANCE, VIEW_DISTANCE + 1):

for z_off in range(-VIEW_DISTANCE, VIEW_DISTANCE + 1):

var chunk_pos = center_chunk + Vector2i(x_off, z_off)

if not loaded_chunks.has(chunk_pos):

generate_chunk(chunk_pos)

loaded_chunks[chunk_pos] = true

# Unload chunks that are too far from the player (outside VIEW_DISTANCE)

func unload_far_chunks(center_chunk: Vector2i):

var to_unload = []

for chunk_pos in loaded_chunks.keys():

# Only unload chunks that are outside the view distance

if abs(chunk_pos.x - center_chunk.x) > VIEW_DISTANCE or abs(chunk_pos.y - center_chunk.y) > VIEW_DISTANCE:

to_unload.append(chunk_pos)

for chunk_pos in to_unload:

unload_chunk(chunk_pos)

loaded_chunks.erase(chunk_pos)

# === Chunk Generation ===

# Generate a single chunk

func generate_chunk(chunk_pos: Vector2i):

var base_x = chunk_pos.x * CHUNK_SIZE

var base_z = chunk_pos.y * CHUNK_SIZE

# Iterate through the chunk size and generate blocks

for x in range(CHUNK_SIZE):

for z in range(CHUNK_SIZE):

var wx = base_x + x

var wz = base_z + z

var height = get_height(wx, wz)

var dirt_depth = randi_range(dirt_depth_base - 1, dirt_depth_base + 2)

for y in range(CHUNK_HEIGHT):

var pos = Vector3i(wx, y, wz)

var block := -1

if y == 0:

block = BLOCK_BEDROCK

elif y < height - dirt_depth:

block = BLOCK_STONE

elif y < height:

block = BLOCK_DIRT

elif y == height:

block = BLOCK_GRASS

if block != -1:

grid_map.set_cell_item(pos, block)

# Trees and floating islands can be added here as well

# For example, generate trees based on random chance

if randf() < tree_spawn_chance:

var tree = generate_tree(wx, height + 1, wz)

for tpos in tree:

grid_map.set_cell_item(tpos, tree[tpos])

# Unload a chunk (clear its blocks)

func unload_chunk(chunk_pos: Vector2i):

var base_x = chunk_pos.x * CHUNK_SIZE

var base_z = chunk_pos.y * CHUNK_SIZE

# Iterate through the chunk size and clear blocks

for x in range(CHUNK_SIZE):

for z in range(CHUNK_SIZE):

var wx = base_x + x

var wz = base_z + z

for y in range(CHUNK_HEIGHT):

var pos = Vector3i(wx, y, wz)

grid_map.set_cell_item(pos, -1)

# === Terrain Generation ===

# Get the terrain height at a specific world position

func get_height(x: int, z: int) -> int:

var base = 10

var variation = terrain_noise.get_noise_2d(x, z) * 10.0

return int(base + variation)

# === Tree Generation ===

func generate_tree(x: int, y: int, z: int) -> Dictionary:

var blocks: Dictionary = {}

var trunk_height = randi_range(4, 5)

for i in range(trunk_height):

var pos = Vector3i(x, y + i, z)

if pos.y < CHUNK_HEIGHT:

blocks[pos] = BLOCK_LOG

var top_y = y + trunk_height

for dx in range(-2, 3):

for dy in range(-2, 3):

for dz in range(-2, 3):

if Vector3(dx, dy, dz).length() <= 2.5:

var leaf_pos = Vector3i(x + dx, top_y + dy, z + dz)

if leaf_pos.y < CHUNK_HEIGHT:

blocks[leaf_pos] = BLOCK_LEAF

return blocks

hi

block stevenson

very swagt and cool and girls kissing and :3

Minecraft Recreated from Memory

We all know what Minecraft looks like... or at least, I think we do? How well do you know Minecraft? How well do I? Take a look and see!

Controls:

  • WASD
  • Space: Jump
  • Shift: "Crouch"
  • Ctrl: Sprint
  • QE: Select Block
  • Alt+F4: Exit

Send me your builds in the Discord/Reddit! :D This project was made for this video: