mirror of
https://github.com/Sheldan/canvas.git
synced 2026-04-21 05:32:41 +00:00
survivors: adding ui elements to use instead of keyboard
This commit is contained in:
@@ -81,4 +81,15 @@ export function getCoordinatesSplit(amount: number) {
|
||||
|
||||
export function randomItem(items: any[]) {
|
||||
return items[Math.floor(Math.random() * items.length)]
|
||||
}
|
||||
|
||||
export function rectPointIntersection(topLeft: Vector, size: Vector, point: Vector) {
|
||||
if (topLeft.x + size.x >= point.x &&
|
||||
topLeft.x <= point.x &&
|
||||
topLeft.y + size.y >= point.y &&
|
||||
topLeft.y <= point.y) {
|
||||
return true
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user