YesNoOk
avatar

VelSet (SCTRLs) (Read 6815 times)

Started by Ricepigeon, September 24, 2015, 05:24:41 pm
Share this topic:
VelSet (SCTRLs)
New #1  September 24, 2015, 05:24:41 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Sets the player's velocity to the specified values. A positive x velocity is in the direction that the player is facing, while a positive y velocity is downward on the screen.

Required parameters:
    none
Optional parameters:
    x = x_value (float)
        Specifies the value to assign to the player's x-velocity.
    y = y_value (float)
        Specifies the value to assign to the player's y-velocity.

Example:
    none

Additional Notes:
A player's velocity is best described as change in pos per tick, with pos corresponding to pixels in the players' coordinate space. For example, a 320x240 character with an X velocity of 160 will move horinzontal 160 spaces per tick, or will have traveled the entire screen's distance in 2 ticks.

Note that if x_value is non-zero and the player's state currently has S-type or C-type physics, the X velocity will be scaled down by that player's respective friction coefficients, so in these situations the player's actual horizontal velocity will be lower than what is defined in the VelSet SCTRL. States with A-type or N-type physics will not have their X velocities affected by friction.

This is also used to replace the deprecated HitVelSet

Example:
[State VelSet]
type = velset
trigger1 =
x = gethitvar(xvel)* facing
Last Edit: December 02, 2015, 03:14:14 pm by Just No Point