Files

74 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# gojo_blue.js — main() (satır 1)
[← gojo_blue.js](index.md) · [← Master](../../wiki.md)
Parça 1/3 · [sonraki](main-2.md)
```javascript
function main(c) {
var player = c.getPlayer();
if (!player) return;
var world = c.getWorld();
var look = player.getLook();
var px = player.getPosition().x;
var py = player.getPosition().y + player.getEyeHeight();
var pz = player.getPosition().z;
var cx0 = px + look.x * 3;
var cy0 = py + look.y * 3;
var cz0 = pz + look.z * 3;
var step = 0;
var maxDistance = 35;
var speed = 2.2;
var pullRadius = 12.0;
var restoredBlocks = [];
function spawn(p, x, y, z, count) {
var t = mappet.getParticleType(p);
if (t) world.spawnParticles(t, true, x, y, z, count, 0.5, 0.5, 0.5, 0.05);
}
function saveBlock(x, y, z, state) {
restoredBlocks.push({ x: x, y: y, z: z, state: state });
}
function restore(ctx) {
for (var i = 0; i < restoredBlocks.length; i++) {
(function(b) {
ctx.scheduleScript(80, function(c2) {
c2.getWorld().setBlock(b.state, b.x, b.y, b.z);
});
})(restoredBlocks[i]);
}
}
function loop(ctx) {
var cx = cx0 + look.x * step;
var cy = cy0 + look.y * step;
var cz = cz0 + look.z * step;
if (!ctx._t) ctx._t = 0;
var t = ctx._t;
// =========================
// 🌪️ HORIZONTAL VORTEX BLUE
// =========================
for (var i = 0; i < 20; i++) {
var p = i / 20;
var angle = t * 0.6 + p * Math.PI * 6;
var radius = 4.5 - p * 3.2;
var x = cx + Math.cos(angle) * radius;
var z = cz + Math.sin(angle) * radius;
```