This is the HFRICTIONS reference page.



Basic Syntax

Each line of HFRICTIONS code must be separated by either a line break or a semicolon. Semicolons are functionally equivalent to line breaks.
A line of code is either a global function or a character function.
A global function is of the form "a(b)" where:
- a is the function name
- b is the function's parameters (if it has any)
A character function is of the form "c.a(b)", where c is the character's "name" as defined in its creation function.
A function may have one or more "synonyms", such as wait() and delay(), which behave identically.

Global Functions

angleMode(mode)

mode=RADIAN, RADIANS, RAD: all angles are treated as being in radians
mode=DEGREE, DEGREES, DEG: all angles are treated as being in degrees
mode=TURN, TURNS, CYCLE, CYCLES, REVOLUTION, REVOLUTIONS, REV: all angles are treated as being in turns
mode=GRADIAN, GRADIANS, GRAD: all angles are measure in gradians
Default: DEGREES
Synonyms: angle

newCharacter(name)

Creates a new character with a name. If this name is already used, the function will fail.
This function creates a default character. To set appearance and character variables, use their functions in the character's namespace immediately after creating it.
Do not confuse a character's internal name with the name of a character in a story. The internal name is only used in the source code and will not be exported.
name (string): name of character
Synonyms: new, char, newChar, newchar, create

polyMode(mode)

mode=DIRECT: the polynomial's output is used directly
mode=NORM: the polynomial's output always starts at 0 and ends at 1
mode=CLAMP: the polynomial's output must be in the range from 0 to 1
mode=BOUNDS: both NORM and CLAMP apply
Default: DIRECT

wait(time)

time (number): amount of seconds to wait
Synonyms: delay


Character Functions

flip(axis)

Reflects a character on an axis. Also see unflip()
axis (x or y): axis to flip on

goto(x,y)

x (number): x-position to move to
y (number): y-position to move to
Synonyms: go

hide()

Makes a character invisible.

image(imageName)

Sets a character's appearance to a certain image. (Custom images are not yet supported.)
imageName (string): image to set to (see list of images)
Synonyms: appearance, costume

label(x,y,text,size)

label(x,y,text,size) The coordinates, text, and/or size can be omitted and rearranged in most ways without causing problems.
x (number): new x position of label, relative to the center of the character
y (number): new y position of label, relative to the center of the character
text (string): text to set label to
size (number): font size
Synonyms: text

layer(z)

Characters with higher layers are rendered in front of characters with lower layers.
z (number): new layer
Synonyms: z

rotate(angle)

Rotates a character by an angle instantly. To rotate smoothly over time, use smoothRotate(). To set the rotation to a specific value, use rotation().
angle (number): angle to set to (depends on global angleMode, default degrees)
Synonyms: turn

rotation(angle)

Sets rotation to a specific value. For relative rotation, use rotate()
angle (number): angle to set to (depends on global angleMode, default degrees)
Synonyms: direction, rot, dir, point

rotation(x,y)

x (number): x component of the position to point towards
y (number): y component of the position to point towards
Synonyms: direction, rot, dir, point

scale(x,y)

Providing only one input will set both scaling directions to the same value.
x (number): new x scaling factor
y (number): new y scaling factor
Synonyms: size

show()

Makes a character visible.

smoothMove(x1,y1,x2,y2,time,[p])

ex: smoothMove(-200,-100,100,100,2,0,1)
x1 (number): starting x-position
y1 (number): starting y-position
x2 (number): ending x-position
y2 (number): ending y-position
time (number): total duration of motion
p (numbers): polynomial used for interpolation (reverse order, without constant term), defaults to 1. ex: move(-40,-30,80,100,1,0,3,-2) will use the smoothstep function for a smoother move
Synonyms: move, glide

smoothRotate(angle1,angle2,time,[p])

angle1 (number): starting angle
angle2 (number): ending angle
time (number): total duration of rotation
p (numbers): polynomial used for interpolation (reverse order, without constant term), defaults to 1. ex: smoothRotate(0,360,1,0,3,-2) will use the smoothstep function for a smoother rotation
Synonyms: spin

smoothScale(xs1,ys1,xs2,ys2,time,[p])

xs1 (number): starting x scale>br>ys1 (number): starting y scale
xs2 (number): ending x scale
ys2 (number): ending y scale
time (number): total duration of scaling
p (number): polynomial used for interpolation (reverse order, without constant term), defaults to 1. ex: smoothScale(1,1,0.5,2,1,0,3,-2) will use the smoothstep function for a smoother squish
Synonyms: stretch, squish

speechBubble(text)

String must be in quotes!
To remove speech bubble, use this function with no parameters.
text (string): text to put in the speech bubble
Synonyms: bub, bubble

toggleVisibility()

Switches whether the character is visible. Also see show() and hide().
Synonyms: vis, visibility, togglevis

unflip()

Resets a character to appear unflipped.

x(x)

x (number): new x position

y(y)

y (number): new y position


List of Images

aple
bear
hippopotamus
koala tree
josh
purple koala tree
whale