2D multiplayer platformer using Godot Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
870 B

class_name GeneratorVoid
extends RefCounted
const NAME := "void"
func generate(world: World, chunk: Chunk) -> void:
var matter: Matter.Layer = chunk.get_or_create_layer(Matter)
var shapes: Shape.Layer = chunk.get_or_create_layer(Shape)
# TODO: Make it easier to create "structures" that cover multiple chunks.
# TODO: These are supposed to be unbreakable.
if chunk.chunk_pos == Vector2i(-1, 0):
for x in range(Chunk.SIZE - 6, Chunk.SIZE):
var local_pos := Vector2i(x, 3)
matter.set_at(local_pos, Matter.PLASTIC)
shapes.set_at(local_pos, Shape.FULL)
# colors[x, 3] = Color.FromHsv(GD.Randf(), 0.1F, 1.0F);
elif chunk.chunk_pos == Vector2i(0, 0):
for x in range(0, 6):
var local_pos := Vector2i(x, 3)
matter.set_at(local_pos, Matter.PLASTIC)
shapes.set_at(local_pos, Shape.FULL)
# colors[x, 3] = Color.FromHsv(GD.Randf(), 0.1F, 1.0F);