Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / What is the command tweening about?

Author
Message
Jo Bach
9
Years of Service
User Offline
Joined: 22nd Dec 2014
Location:
Posted: 19th Oct 2015 19:31
Hello,

Most code is easy to understand in the command manual.

I see it in the command manual, but can't find a proper translation in Dutch of tweening.

I've read the discriptions, but I still don't understand these. Also no code examples underneath these.

Like ´CreateTweenCamera´ and ´AddTweenChainCamara´, duration, what is this about?

To me it make more sence if someone can give me some examples (not the coding) in gametypes how to use the tween command. Then it is easyer to understand for me.

Thank you.
Fluorescent
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 19th Oct 2015 20:04 Edited at: 19th Oct 2015 20:13
Tweening is a special word, it comes from the phrase In Between. It basically works like this, you set two points, for example a start point and an end point for movement. Then you set the time you want your object to move between these points. AppGameKit will then do the calculations of how the object needs to move IN BETWEEN these points for you and move the object.

I am using it in my Sokoban clone. When the character moves I first get the position where he stands and the position where I want him to walk, then set up a TweenSprite for the movement, a duration of 0.3 seconds and AppGameKit will then move the player character for me. It turned out to be very useful.

I've also used tweening for animating text on the title-screen. Once you get your head around it, it's really powerful. You can do a lot more than just move objects, you can scale them, rotate them, change colours and such. I think a tween chain is a way of playing several tweens one after the other.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Oct 2015 20:10 Edited at: 19th Oct 2015 20:10
The targets in this video are animated with tweens. There are tweens to move the targets up and down (set start point, end point, speed and interpolation). There is also a tween for transparency.



The code is here - http://www.thegamecreators.com/pages/newsletters/newsletter_issue_152.html#12
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Jo Bach
9
Years of Service
User Offline
Joined: 22nd Dec 2014
Location:
Posted: 20th Oct 2015 22:00
Thanks for the information and example.

Now it is getting clear for me.

Ik will go play/experiment with it.

Login to post a reply

Server time is: 2024-11-23 22:13:22
Your offset time is: 2024-11-23 22:13:22