-
Notifications
You must be signed in to change notification settings - Fork 71
Home
By @RnbwNoise.
var x = 10;
setInterval(function() {
var t = x / 80;
IIC.setAngle(Math.cos(t) * (Math.PI / 4));
IIC.makeGhost(x, 50 + 100 * (Math.sin(t) + 1));
x += 30;
if(x > 800)
x = 10;
}, 300);
Adds an event handler and returns its identifier (an array).
-
string event-- event name. -
function(...) listener-- the function to be called when the event occurs.-
object eventData-- the data associated with the event.
-
Removes an event handler. Returns true if the listener was successfully removed.
-
[ string, int ] listenerId-- event handler identifier.
Returns your id.
Returns the ids of all connected users.
Returns true if a user is still connected.
-
string userId-- user's id.
Adds a new connection handler and returns its identifier.
-
function(...) listener-- the function to be called when a new user joins the room.-
string userId-- new user's id.
-
Adds a chat message handler and returns its identifier.
-
function(...) listener-- the function to be called when a new message (including your own) is posted in the chat.-
string userId-- author's id. -
string name-- author's name (set usingrename()). -
string message-- message text.
-
Returns a user's country code (ISO 3166-1 Alpha-2) or null if that user is disconnected.
-
string | undefined userId-- user's id. Ifundefined, the function will return your current country code.
Changes your country and flag.
-
string countryCode-- the code of the new country.
Returns the width of a flag in pixels.
-
string countryCode-- the country code.
Returns the height of a flag in pixels.
-
string countryCode-- the country code.
Returns the position of a flag or null if it does not exist.
-
string | undefined userId-- user's id. Ifundefined, the function will return your current position.
Moves your flag.
-
int xandint y-- the point where to move the flag to.
Sets a flag movement handler and returns its identifier.
-
function(...) listener-- a function to be called when a flag is moved.-
string userId-- user's id. -
int newXandint newY-- the new location of the flag.
-
Returns a user's angle of flag rotation (in radians) or null if that user is disconnected.
-
string | undefined userId-- user's id. Ifundefined, the function will return your current angle of rotation.
Sets your flag's angle of rotation.
-
float angle-- new angle of rotation in radians.
Sets a flag rotation handler and returns its identifier.
-
function(...) listener-- a function to be called when a flag is rotated.-
string userId-- user's id. -
int newAngle-- the new angle of flag rotation in radians.
-
Creates a concentric "wave".
-
int xandint y-- the coordinates of a point where the wave will be created.
Sets a wave handler and returns its identifier.
-
function(...) listener-- a function to be called when a wave is created.-
string userId-- user's id. -
int waveXandint waveY-- the location of the wave.
-
Sets a ghost handler and returns its identifier.
-
function(...) listener-- a function to be called when a ghost is created.-
string userId-- user's id. -
int ghostXandint ghostY-- the location of the ghost.
-
Sets a ghost handler and returns its identifier.
-
function(...) listener-- a function to be called when a ghost is created.-
string userId-- user's id. -
int ghostXandint ghostY-- the location of the ghost.
-
The following functions draw shapes on the screen that will only be visible to you.
Draws a point and returns its id.
-
int xandint y-- the location of the point. -
string color-- the color of the point.
Draws a line and returns its id.
-
int x1andint y1-- the location of the first point. -
int x2andint y2-- the location of the second point. -
string color-- the color of the line.
Draws a ray and returns its id.
-
int xandint y-- the position of the ray's initial point. -
float length-- the length of the ray in pixels. -
float angle-- the angle between the positive x-axis and the ray. -
string color-- the color of the ray.
Draws a string and returns its id.
-
int xandint y-- the position of the top left corner of the textbox. -
string text-- text to be written on the screen. -
string color-- color of the string.
Draws a ghost flag and returns its id.
-
int xandint y-- the position of the center point of the flag. -
float a-- the angle of flag's rotation in radians. -
string countryCode-- the flag's country code.
Erases a debugging mark. Returns true if the mark was successfully erased.
-
int elementId-- the mark's id.
Erases all debugging marks.