1
0
Fork 0
mirror of https://github.com/thepaperpilot/Advent-Incremental.git synced 2025-03-22 06:01:40 +00:00

Fixed particle effects

This commit is contained in:
thepaperpilot 2022-12-24 01:43:57 -06:00
parent a5297ed88a
commit e43e065daf

View file

@ -105,44 +105,26 @@ export const main = createLayer("main", function (this: BaseLayer) {
style: "z-index: -1"
}));
particles
.addEmitter({
const emitter = particles.addEmitter({
emit: false,
autoUpdate: true,
lifetime: { min: 5, max: 5 },
emitterLifetime: -1,
pos: { x: 0, y: 0 },
frequency: 0.05,
maxParticles: 1000,
behaviors: [
{
type: "alpha",
type: "alphaStatic",
config: {
alpha: {
list: [
{
value: 1,
time: 0
},
{
value: 1,
time: 1
}
]
}
alpha: 1
}
},
{
type: "scale",
type: "scaleStatic",
config: {
scale: {
list: [
{
value: 1,
time: 0
},
{
value: 1,
time: 1
}
]
}
min: 1,
max: 1
}
},
{
@ -194,8 +176,8 @@ export const main = createLayer("main", function (this: BaseLayer) {
data: {
x: 0,
y: 0,
width: 800,
height: 10
w: 800,
h: 1
}
}
},
@ -206,9 +188,11 @@ export const main = createLayer("main", function (this: BaseLayer) {
}
}
]
})
.then(e => {
e.autoUpdate = true;
});
watchEffect(() => {
const shouldEmit = day.value === 25;
emitter.then(e => (e.emit = shouldEmit));
});
const currentlyMastering = computed(() =>
@ -764,11 +748,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
</button>
</>
) : null}
{
render(
particles
) /*creditsOpen.value || day.value == 25 ? render(particles) : null*/
}
{render(particles)}
</>
))
};