Move Object Functions

From Danmakufu Wiki
Jump to: navigation, search

Functions used to control object movement. The AddPattern functions also serve as replacements for the CreateShotA system used in 0.12m.

ObjMove_SetX

Arguments:
 1) object ID (real)
 2) x coordinate (real)

Sets the x coordinate of the specified object.

ObjMove_SetY

Arguments:
 1) object ID (real)
 2) y coordinate (real)

Sets the y coordinate of the specified object.

ObjMove_SetPosition

Arguments:
 1) object ID (real)
 2) x coordinate (real)
 3) y coordinate (real)

Sets the x and y of the specified object.

ObjMove_SetSpeed

Arguments:
 1) object ID (real)
 2) speed (real)

Sets the movement speed per frame for the object.

ObjMove_SetAngle

Arguments:
 1) object ID (real)
 2) angle (real)

Sets the movement angle for the object.

ObjMove_SetAcceleration

Arguments:
 1) object ID (real)
 2) acceleration (real)

Sets the movement acceleration per frame for the object.

ObjMove_SetMaxSpeed

Arguments:
 1) object ID (real)
 2) speed (real)

Sets the maximum/minimum speed which the object will approach using the ObjMove_SetAcceleration function.

ObjMove_SetAngularVelocity

Arguments:
 1) object ID (real)
 2) angular velocity (real)

Sets the change in movement angle per frame for the object.

ObjMove_SetDestAtSpeed

Arguments:
 1) object ID (real)
 2) x coordinate (real)
 3) y coordinate (real)
 4) velocity (real)

Moves the object towards the given coordinates at the speed specified.

ObjMove_SetDestAtFrame

Arguments:
 1) object ID (real)
 2) x coordinate (real)
 3) y coordinate (real)
 4) frames (real)

Moves the object towards the given coordinates in the number of frames specified.

ObjMove_SetDestAtWeight

Arguments:
 1) object ID (real)
 2) x coordinate (real)
 3) y coordinate (real)
 4) weight (real)
 5) max speed (real)

Moves the object towards the given coordinates. It will slow down near the end of the movement based on the weight specified.

ObjMove_AddPatternA1

Arguments:
 1) object ID (real)
 2) frame (real)
 3) speed (real)
 4) angle (real)

After the specified number of frames, changes the speed and angle of the object. NO_CHANGE can be used to preserve the original speed or angle.

ObjMove_AddPatternA2

Arguments:
 1) object ID (real)
 2) frame (real)
 3) speed (real)
 4) angle (real)
 5) acceleration (real)
 6) angular velocity (real)
 7) max speed (real)

Similar to ObjMove_AddPatternA1. Can change object acceleration, angular velocity, and maximum speed. NO_CHANGE can also be used for these new parameters.

ObjMove_AddPatternA3

Arguments:
 1) object ID (real)
 2) frame (real)
 3) speed (real)
 4) angle (real)
 5) acceleration (real)
 6) angular velocity (real)
 7) max speed (real)
 8) bullet graphic (real)

Similar to ObjMove_AddPatternA2. Changes the bullet graphic. (Similar to SetShotDataA, but with acceleration and angular velocity swapped)

ObjMove_AddPatternA4

Arguments:
 1) object ID (real)
 2) frame (real)
 3) speed (real)
 4) angle (real)
 5) acceleration (real)
 6) angular velocity (real)
 7) max speed (real)
 8) target ID (real)
 9) bullet graphic (real)

Similar to ObjMove_AddPatternA3. The angle parameter is relative to the angle from the object to the target. For example, if GetPlayerObjectID is used as the target, an angle of 0 will cause the object to aim for the player. (Replaces SetShotDirectionType)

ObjMove_AddPatternB1

Arguments:
 1) object ID (real)
 2) frame (real)
 3) x speed (real)
 4) y speed (real)

After the specified number of frames, changes the x and y movement speeds of the object. NO_CHANGE can be used to preserve the original speeds.

ObjMove_AddPatternB2

Arguments:
 1) object ID (real)
 2) frame (real)
 3) x speed (real)
 4) y speed (real)
 5) x acceleration (real)
 6) y acceleration (real)
 7) x max speed (real)
 8) y max speed (real)

Similar to ObjMove_AddPatternB1. Can change object x/y acceleration and x/y maximum speed. NO_CHANGE can also be used for these new parameters.

ObjMove_AddPatternB3

Arguments:
 1) object ID (real)
 2) frame (real)
 3) x speed (real)
 4) y speed (real)
 5) x acceleration (real)
 6) y acceleration (real)
 7) x max speed (real)
 8) y max speed (real)
 9) bullet graphic (real)

Similar to ObjMove_AddPatternB2. Can also change the bullet graphic. (Replaces SetShotDataA_XY)

ObjMove_GetX

Arguments:
 1) object ID (real)

Returns the x coordinate of the object.

ObjMove_GetY

Arguments:
 1) object ID (real)

Returns the y coordinate of the object.

ObjMove_GetSpeed

Arguments:
 1) object ID (real)

Returns the movement speed of the object.

ObjMove_GetAngle

Arguments:
 1) object ID (real)

Returns the movement angle of the object.