Releases: yetnt/disgamekit
Releases · yetnt/disgamekit
v2.2.0
2.1.1 Docs update
Finnally documented the new arts of PlaneObject class
PlaneObject Class
The PlaneObject class represents an object that can be placed on the Plane. It emits events for collision detection and can be used to create interactive game elements.
Constructor
Parameters
plane
: Plane instance.x
: The object's origin on the x-axisy
: The object's origin on the y-axisid
: A unique identifier for the object.value
:(optional) The emoji or value to display on the plane for said object. Defaults to the object's ID.detectCollision
:(optional) Whether to detect collisions with other objects. Defaults totrue
ai
: (optional) Enable Auto-Movement
const { Plane, PlaneObject } = require('disgamekit');
let plane = new Plane(...)
let hat = new PlaneObject(plane, 0, 0, 'hat', '🧢');
Methods
isAi
Check if current PlaneObject is an AI
const { Plane, PlaneObject } = require('disgamekit');
let plane = new Plane(...)
let hat = new PlaneObject(plane, 0, 0, 'hat', '🧢', false, true);
hat.isAi() // true
start
Start tracking specified target
Parameters
target
: another PlaneObject to target
let apple = new PlaneObject(plane, 5, 5, 'apple', 'a');
hat.start(apple);
step
Step 1 grid space closer to the target
Parameters
target
: (optional) Override current target with new target
hat.step(); // since it's tracking apple at (5, 5), hat will go to (1, 1)
stop
Stop running the AI
hat.stop();
hat.step(); // AI has not been started!
Full Changelog: 2.1.0...2.1.1
2.1.0 Fixes
2.0.0
1.1.0
1.0.3 console.log("hi")
The plane would log to the copnsole hi when the game hasnt started but the #plane.update()
method was called.
I remoevd that but i might make it log a TypeError.
Full Changelog: 1.0.2...1.0.3
1.0.2 Last update
I fully checked README. No errors.
Full Changelog: 1.0.1...1.0.2
1.0.1 readme update :D
Full Changelog: 1.0.0...1.0.1
1.0.0 Initial Release
Initial Release.