Other Functions

From Danmakufu Wiki
Jump to: navigation, search

StartSlow

Arguments:
    1) Slow Target
         - TARGET_ALL
    2) FPS Slow Value (0-60)

Creates a pseudo slow effect by forcing Danmakufu to run at the specified FPS value. There is currently only one target available, TARGET_ALL. Use StopSlow to stop this effect.

StopSlow

Arguments:
    1) Slow Target
         - TARGET_ALL

Removes the pseudo slow, and restores Danmakufu to normal FPS.

IsIntersected_Line_Circle

Arguments:
    1) Starting X coordinate of the line
    2) Starting Y coordinate of the line
    3) Ending X coordinate of the line
    4) Ending Y coordinate of the line
    5) Width of the line
    6) X coordinate of the center of the circle
    7) Y coordinate of the center of the circle
    8) Radius of the circle
Returns:
    Boolean

Checks if the given line is colliding with the given circle. Returns true if there is a collision; if there is no collision, it returns false.

IsIntersected_Obj_Obj

Arguments:
    1) Object ID 1
    2) Object ID 2
Returns:
    Boolean

Checks if the given objects are colliding with each other. Returns true if there is a collision; if there is no collision, it returns false. This function is currently only available on bullet and laser objects.

GetObjectDistance

Arguments:
    1) Object ID 1
    2) Object ID 2
Returns:
    Integer

Returns the distance between the two objects. If one of the objects' ID is invalid, -1 will be returned.

GetObject2dPosition

Arguments:
    1) Object ID 1
Returns:
    Array

Returns the 2D coordinates of a 3D object. The array is returned as [X, Y].

Get2dPosition

Arguments:
    1) X
    2) Y
    3) Z
Returns:
    Array

Returns the 2D coordinates of the given 3D coordinates. The array is returned as [X, Y].

erase

2 Parameters
    1) Array
    2) Index
Return value
    The given array, with the element at the given index removed

Removes the element at the given index from an array.

length

1 Parameter
    1) Array
Return value
    The size of the array

Gets the size of an array

concatenate

2 Parameters
    1) Array 1
    2) Array 2
Return value
    Merged Array

Merges two arrays into one ( ~ symbol can also be used instead)

Example:

 let array1 = [0, 0];
 let array2 = [1, 1];
 let array3 = concatenate(array1, array2); or let array3 = array1 ~ array2;

array3 will now return [0, 0, 1, 1].

slice

2 Parameters
    1) Array
    2) Starting cutoff
    3) Ending cutoff
Return value
    The indices in between the cutoff values (this includes the starting cutoff index but not the ending cutoff index).

Cuts out a specific portion of an array.

Array[starting..ending]; Can also be used.