Skip to content

Releases: YetNT/disgamekit

v2.2.0

09 Dec 07:55
Compare
Choose a tag to compare

ComplexPlaneObject

Now you can create lines from point A to B!
(read the damn docs)

Full Changelog: 2.1.1...2.2.0

2.1.1 Docs update

20 Sep 16:28
Compare
Choose a tag to compare

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-axis
  • y: The object's origin on the y-axis
  • id: 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 to true
  • 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

20 Sep 16:07
Compare
Choose a tag to compare

Fixed imports

Fixed optional parameters being required

Full Changelog: 2.0.0...2.1.0

2.0.0

29 Aug 19:35
Compare
Choose a tag to compare

Move to TS

New AI shi, i'll document it later, but for now a planeobject with ai enabled can go to any object o a plane

Full Changelog: 1.1.0...2.0.0

1.1.0

30 Jul 06:55
Compare
Choose a tag to compare

Turns System

Usage in README

Full Changelog: 1.0.3...1.1.0

1.0.3 console.log("hi")

06 Jul 14:17
Compare
Choose a tag to compare

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

05 Jul 17:31
Compare
Choose a tag to compare

I fully checked README. No errors.

Full Changelog: 1.0.1...1.0.2

1.0.1 readme update :D

05 Jul 17:20
Compare
Choose a tag to compare

1.0.0 Initial Release

05 Jul 16:15
Compare
Choose a tag to compare

Initial Release.