minecraft-demo | Multi-Server Minecraft Worlds with Docker | Continuous Deployment library
kandi X-RAY | minecraft-demo Summary
kandi X-RAY | minecraft-demo Summary
Multi-Server Minecraft Worlds with Docker
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of minecraft-demo
minecraft-demo Key Features
minecraft-demo Examples and Code Snippets
Community Discussions
Trending Discussions on minecraft-demo
QUESTION
Following the Minecraft demo. How can I make the blocks not to spawn in the same place? This is the script which spawns the boxes.
There are two approaches which I can think of:
- Create a tracking list of the coordinates which I've set up a box, and prevent creating one if the intersection point matches (or is close to a threshold).
- Check if the reticule matches a bounding box (Using Threejs' Box3, which I don't know how to use).
Any ideas on the best way to approach this?
...ANSWER
Answered 2017-Jun-09 at 19:42This is my answer to #2: I created an array. This array will contain the points of evt.detail.intersection.point. Before inserting a new object, I apply Pythagoras (x, and z points), and compare it with a threshold. Only if it's above the threshold I allow it to continue, and store the new points in it.
The whole code is below, with comments:
I used some TypeScript in here, I will not include it so it reaches a broader audience.
I wrapped the intersection-spawn component with an ES2015 class just for the sake of separating the code. I don't know of a native way of creating A-Frame through ES2015.
This is the main class "intersection-spawn.js"
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install minecraft-demo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page