Skip to content

Instantly share code, notes, and snippets.

@markusrt
Created September 25, 2012 20:15
Show Gist options
  • Select an option

  • Save markusrt/3784166 to your computer and use it in GitHub Desktop.

Select an option

Save markusrt/3784166 to your computer and use it in GitHub Desktop.

Revisions

  1. markusrt created this gist Sep 25, 2012.
    11 changes: 11 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    if(
    // NEW instead of movement.isMoving
    movement.speed>movement.walkSpeed/10

    && !"runRight".Equals(sprite._animFrameset))
    {
    sprite.PlayLoop("runRight");

    // NEW adapt playback speed based on movement speed
    sprite.speed = movement.speed/movement.walkSpeed;
    }