(AGK version: 2.0)
Submitted: 2014-01-30 09:46:30
// Simple Sprite Tween Example

// Load a sample image
image001 = LoadImage("/media/football128.png")

// Create a standard sprite
// Position the sprite to the left of the screen as we will
// tween its position to the right.
sprite001 = CreateSprite(image001)
SetSpriteSize(sprite001,20,20)
SetSpritePosition(sprite001,0,50)

// Create a simple x translation tween with bounce easing
// over 2 seconds. ( Time includes easing)!
tweenSprite001 = CreateTweenSprite( 2 )
SetTweenSpriteX( tweenSprite001, 0, 80, TweenBounce())

// Set the tween to start playing on the sprite
// Delay the start by half a second
PlayTweenSprite( tweenSprite001, sprite001, .5 )

// Main Loop
do
 Print("Simple Sprite Tween Example")
 // Update tweens
 UpdateAllTweens( GetFrameTime() )
 Sync()
loop
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.