Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Understanding BSP for Procedural Level Generation

Notifications You must be signed in to change notification settings

Davidslv/binary-space-partitioning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BSP - Binary Space Partitioning Algorithm

References:

  # Walkthrough
  parent = Node.new(x: 10, y: 10, width: 100, height: 50)
  parent.left = Node.new(x: 10, y: 10, width: (parent.width / 2), height: (parent.height / 2))
  parent.right = Node.new(x: 10, y: 10, width: (parent.width / 2), height: (parent.height / 2))

  parent.left.parent = parent
  parent.right.parent = parent

  parent.left.sisters << parent.right
  parent.right.sisters << parent.left

  parent.leaf?
  parent.left.leaf?
  parent.right.leaf?
$ pry -r ./creator.rb
pry(main)> c = Creator.new(width: 100, height: 100)
pry(main)> tree = c.setup

About

Understanding BSP for Procedural Level Generation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages