(AGK version: 108.14)
Submitted: 2014-01-30 09:50:07
// Simple Sprite Tween Example ( Translate x and y values in the same tween )

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

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

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

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

// Create a simple y translation tween with bounce easing
// over 2 seconds. ( Time includes easing)!
SetTweenSpriteY( 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.