Skip to content

Instantly share code, notes, and snippets.

@torralbaa
Created November 23, 2019 02:26
Show Gist options
  • Save torralbaa/289d629a0fb0a9788fbcc4ab899834a0 to your computer and use it in GitHub Desktop.
Save torralbaa/289d629a0fb0a9788fbcc4ab899834a0 to your computer and use it in GitHub Desktop.
Gianthug
/*
* gianthug.js
*
* Copyright 2019 Alvarito050506 <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
function sleep(ms)
{
return new Promise(resolve => setTimeout(resolve, ms));
}
async function gh()
{
while(true)
{
Object.keys(world.room.players).forEach((id) => {
if(world.room.players[id]["critterId"] == "huggable")
{
world.room.players[id].critter.scaleX = 5;
world.room.players[id].critter.scaleY = 5;
}
});
await sleep(1000);
}
}
gh();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment