survivors: adding ui elements to use instead of keyboard

This commit is contained in:
Sheldan
2025-09-07 20:01:20 +02:00
parent c9c063b477
commit 70c19f2851
4 changed files with 157 additions and 3 deletions

View File

@@ -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;
}
}