0.1.0 • Published 5 years ago

aframe-spawnpoint-component v0.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

npm.io

aframe-spawnpoint-component

Version License

DEMO

Spawn A-Frame entities from a point.

For A-Frame.

API

PropertyDescriptionDefault Value
sizepool size10
patternrandom, evenrandom
originOrigin of the spawn pattern{x: 0, y: 0, z: 0}
radiusRadius around the origin10
enableYEnable random on y-axisfalse
rateHow often to spawn, in milliseconds. If 0, spawn all at once.0

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-spawnpoint-component/dist/aframe-spawnpoint-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity spawnpoint__enemy="size: 20; radius: 100;"></a-entity>
    <a-assets>
        <a-mixin id="enemy" geometry="primitive: box;" material="color: red;"></a-mixin>
    </a-assets>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-spawnpoint-component

Then require and use.

require('aframe');
require('aframe-spawnpoint-component');