GithubHelp home page GithubHelp logo

renosyah / chunk_management_demo Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 32 KB

is a handy module to handle your chunk, if you make open world with procedural terrain this module can help you manage witch chunk need to be remove & added to scene

GDScript 100.00%

chunk_management_demo's Introduction

Chunk management demo

is a handy module to handle your chunk, if you make open world with procedural terrain this module can help you manage witch chunk need to be remove & added to scene

How to use

for more detail, tun this project and see map.gd


onready var chunk_management = $chunk_management

func generate_map():
	chunk_management.start_position = start_position
	chunk_management.chunk_size = chunk_size
	chunk_management.chunk_margin = 1
	chunk_management.chunk_scale = chunk_management.ChunkScale.NORMAL
	chunk_management.init_starter_chunk()
	
# update camera current position
# chunk manager will emit signal
# to update your map
func update_camera_location(character_location :Vector2):
	chunk_management.update_camera_location(character_location)
	
# receive signal to update map
# by adding new chunk & removing chunk
func _on_chunk_management_update_map(_chunks_to_remove :Array, _chunks_to_add :Array):
	for i in _chunks_to_remove:
		var data :ChunkManagement.ChunkData = i
		_despawn_chunk(data)
		
	for i in _chunks_to_add:
		var data :ChunkManagement.ChunkData = i
		_spawn_chunk(data)

About GoDot

See GoDot Game Engine.

chunk_management_demo's People

Contributors

renosyah avatar

Stargazers

Agung Setiawan avatar  avatar

Watchers

 avatar

Forkers

r2d2m

chunk_management_demo's Issues

Ini Untuk Godot 3 Kah?

Bang, mau kasih saran, kalo bisa tambahin detail versi godot yang lu pake di README.md, percuma aku nih udah ku clone, eh ternyata versinya godot 3

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.