(AGK version: 108.15)
Submitted: 2013-07-18 02:03:10
Setvirtualresolution(640,480)
ResetTimer()
//Create Four Images, 11 to 14
Dim x[3]=[16,31,16,0]
Dim y[3]=[0,16,31,16]
Swap()
For i=0 to 3
    Drawline(16,16,8,24,0,255,0)
    Drawline(16,16,x[i],y[i],255,255,0)
    Update(0)
    Render()
    GetImage(i+11,0,0,31,31)
    ClearScreen()
Next i
//Create Sprite Frames
id=CreateSprite(11)
For i=11 to 14
    AddSpriteAnimationFrame(id,i)
Next i
//Set Background
SetClearColor(50,50,100)
SetSpritePosition(id,100,100)
AddVirtualButton(1,480,420,80)
SetVirtualButtonText(1,"Speed")
speed=1
//Start Animation
PlaySprite(id,speed)

Do
    Print("Current Speed:"+Str(speed,0))
    If GetVirtualButtonPressed(1)
        Inc speed
        SetSpriteSpeed(id,speed)
    EndIf
    Sync()
    If Timer()>20 Then Exit
Loop
End
Help make AGK better by submitting an example for this command!
(All examples are subject to approval)
Login to post an example of your own.