Socket
Socket
Sign inDemoInstall

game-engine-util

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    game-engine-util

A library that offers a lot of useful functions for making games & game engines.


Version published
Maintainers
1
Created

Readme

Source

Game Engine Util

This is a simple library containing math functions and stuff you'd need for making nice game engines.

Documention

Everything in src/exports.js is well and self documented.
If you want to see the functions and how to use them, look in there.

Motivation

Making these functions yourself is a pain in the ass which is why I just made the ones I made available for everyone.

Getting started

const util = require("game-engine-util");

const vec = new util.Vector2d(10.32, 47.47);
const vec2 = new util.Vector2d(0.32, 21);

util.getDistance2d(vec.x, vec.y, vec2.x, vec2.y); // 28.295952007310163

const line = new util.Line(vec, vec2);
const square = new util.Square(5, 40, 100, 100);

util.GetLineAndPolyCollision(line, square); // { bool: true, intersections: Vector2d { x: 7.497937287495278, y: 40 } }

Keywords

FAQs

Last updated on 10 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc