Skip to content

Instantly share code, notes, and snippets.

@EliTheCoder
Last active December 25, 2018 01:33
Show Gist options
  • Save EliTheCoder/20fcceb4cb8c2a389cb1c3da3ef913c3 to your computer and use it in GitHub Desktop.
Save EliTheCoder/20fcceb4cb8c2a389cb1c3da3ef913c3 to your computer and use it in GitHub Desktop.
let person = 0;
let toggle = false;
window.addEventListener("keydown", (e)=>{
if (e.keyCode == 219) {
if (person == 0) {
person = IIC.getConnectedIds.length-1;
} else {
person--;
}
}
if (e.keyCode == 221) {
if (person == IIC.getConnectedIds.length-1) {
person = 0;
} else {
person++;
}
}
});
setInterval(()=>{
toggle = !toggle;
let ux = IIC.getPosition(IIC.getConnectedIds()[person]).x;
let uy = IIC.getPosition(IIC.getConnectedIds()[person]).y;
IIC.setAngle(IIC.getAngle()+Math.PI*2/50);
IIC.setPosition(ux+50*Math.sin(IIC.getAngle()),uy+50*Math.cos(IIC.getAngle()));
IIC.makeWave(IIC.getPosition().x,IIC.getPosition().y);
if (toggle) IIC.makeGhost(IIC.getPosition().x,IIC.getPosition().y);
},100);
@EliTheCoder
Copy link
Author

This is a script for isitchristmas.com. It makes it so your flag makes circles around a random flag. Use [ and ] to change which flag you're rotating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment