jdoleary / Spellmasons

https://store.steampowered.com/app/1618380/Spellmasons/
Other
0 stars 1 forks source link

Art: Auras #231

Open jdoleary opened 6 months ago

jdoleary commented 6 months ago

Auras are a circular area that you can cast on the ground or on a unit. Any units or pickups that enter the auras radius gain the effect of the aura. In-game auras can be done with the particle engine.

Since there's potential for tons of aura spells (they could be their own category), the spell icon should be extremely reusable. I often tint existing icons to make new spells. Instructions for Che: this icon should be exported in layers so that the tintable parts (the aura itself) can be easily tinted by Jordan later while the background and border can be added after tinting.

jdoleary commented 1 month ago

Aura emitter: https://github.com/pixijs/particle-emitter/blob/master/src/behaviors/shapes/Torus.ts

jdoleary commented 1 month ago
function getRandomPointOnCustomOval(semiMajorAxis, semiMinorAxis) {
    // Generate semiMajorAxis random angle between 0 and 2*PI
    const t = Math.random() * 2 * Math.PI;

    // Calculate the coordinates based on the parametric equations
    const x = semiMajorAxis * Math.cos(t);
    const y = semiMinorAxis * Math.sin(t);

    return { x: x, y: y },
}
jdoleary commented 4 weeks ago

Aura particle effect added in: 44ee4659c927c5bdd1a07f77acfaa43d06eb8de0

Sample usage: auraEmitter({x:0,y:0}, 59, false);