ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.32k stars 254 forks source link

Vector support? #112

Open mount2010 opened 7 years ago

mount2010 commented 7 years ago

I believe that having support for basic vector operations (dot, etc), which are used a lot in roguelike programming, especially since roguelikes typically use 2D grids a lot, will be helpful to have in a roguelike library.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40994872-vector-support?utm_campaign=plugin&utm_content=tracker%2F297828&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F297828&utm_medium=issues&utm_source=github).
ondras commented 7 years ago

This is a reasonable request. But please keep in mind that rot.js is built around the premise that no data structures are imposed on the developer; routines that return complex data structures use callbacks instead. So introducing a (fixed) vector data type would break this premise.

I would highly suggest using glMatrix for all your vector/matrix needs.