UNPKG

moomooio-client

Version:

MooMooIO-Client is a client-side wrapper API designed for the game MooMoo.io. This package aims to provide a simple yet powerful API for creating clones, mods, or plugins for MooMoo.io.

14 lines (11 loc) 575 B
import projectiles from "../data/projectiles"; type ReturnProjectile = (typeof projectiles)[number] | undefined; export default function getProjectile(projectileSrc: string): ReturnProjectile; export default function getProjectile(projectileType: number): ReturnProjectile; export default function getProjectile(projectileTypeOrSrc: number | string): ReturnProjectile { if (typeof projectileTypeOrSrc == "string") return projectiles.find((projectile) => projectile.src == projectileTypeOrSrc); else { return projectiles[projectileTypeOrSrc]; } }