Search in sources :

Example 1 with MAP_POINTS

use of eidolons.libgdx.screens.map.layers.MapMoveLayers.MAP_POINTS in project Eidolons by IDemiurge.

the class MapParticles method init.

public void init() {
    map.put(null, new ArrayList<>());
    for (DAY_TIME sub : DAY_TIME.values()) {
        map.put(sub, new ArrayList<>());
    }
    load();
    for (MAP_EMITTER_GROUP sub : MAP_EMITTER_GROUP.values()) {
        boolean displayed = false;
        for (DAY_TIME time : sub.times) {
            if (time == this.time) {
                displayed = true;
                break;
            }
        // same check for weather perhaps
        }
        if (sub.points != null)
            for (MAP_POINTS point : sub.points) {
                for (int i = 0; i < sub.number; i++) {
                    int mod = (i % 2 == 0) ? 1 : -1;
                    int offsetX = mod * sub.distance * i;
                    mod = (i % 3 == 0) ? 1 : -1;
                    int offsetY = mod * sub.distance * i;
                    EmitterActor emitter = create(sub.sfxPath, point.x + offsetX, point.y + offsetY, time);
                    if (displayed) {
                        this.displayed.add(emitter);
                    }
                }
            }
    }
    initialized = true;
}
Also used : MAP_POINTS(eidolons.libgdx.screens.map.layers.MapMoveLayers.MAP_POINTS) DAY_TIME(main.content.enums.macro.MACRO_CONTENT_CONSTS.DAY_TIME) EmitterActor(eidolons.libgdx.anims.particles.EmitterActor)

Aggregations

EmitterActor (eidolons.libgdx.anims.particles.EmitterActor)1 MAP_POINTS (eidolons.libgdx.screens.map.layers.MapMoveLayers.MAP_POINTS)1 DAY_TIME (main.content.enums.macro.MACRO_CONTENT_CONSTS.DAY_TIME)1