Skip to content

Instantly share code, notes, and snippets.

View faizux's full-sized avatar
🚀
👨‍💻 Code, 🎨 Design, 🎮 Gaming

Faiz ul Hassan | Frontend dev @urducanvas faizux

🚀
👨‍💻 Code, 🎨 Design, 🎮 Gaming
View GitHub Profile
@joshuabradley012
joshuabradley012 / Object collisions with canvas
Last active June 3, 2025 18:30
An example of 2D collisions using JavaScript Canvas
class State {
constructor(display, actors) {
this.display = display;
this.actors = actors;
}
update(time) {
/**
* provide an update ID to let actors update other actors only once
@rlingineni
rlingineni / cavasHelper.ts
Created February 4, 2020 02:10
Aligning Guidelines with Fabric.js + Typescript. This is a modifed version of the code here: https://github.com/fabricjs/fabric.js/blob/master/lib/aligning_guidelines.js
import { fabric } from "fabric";
import { ILineOptions } from "fabric/fabric-impl";
/**
* Should objects be aligned by a bounding box?
* [Bug] Scaled objects sometimes can not be aligned by edges
*
*/