# Hey i have a line of code that i dont understand\[Solved\]

**URL:** <https://phaser.discourse.group/t/hey-i-have-a-line-of-code-that-i-dont-understand-solved/618>\
**Category:** Phaser 2 / CE\
**Created:** [January 6, 2019, 10:00pm UTC](https://phaser.discourse.group/t/hey-i-have-a-line-of-code-that-i-dont-understand-solved/618 "2019-01-06T22:00:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigSalade](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@BigSalade](https://phaser.discourse.group/u/BigSalade)\
**Post date:** [January 6, 2019, 10:00pm UTC](https://phaser.discourse.group/t/hey-i-have-a-line-of-code-that-i-dont-understand-solved/618/1 "2019-01-06T22:00:06Z")

</div>

Hey this is a line of code from a program that creates mummies but i dont understand this line can someone help.

game.add.tween(mummy).to({ x: game.width + (1600 + mummy.x) }, 20000, Phaser.Easing.Linear.None, true);

---

<div class="post-metadata">

**Author:** ![wclarkson](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/wclarkson/32/205_2.png) [@wclarkson](https://phaser.discourse.group/u/wclarkson)\
**Post date:** [January 6, 2019, 11:01pm UTC](https://phaser.discourse.group/t/hey-i-have-a-line-of-code-that-i-dont-understand-solved/618/2 "2019-01-06T23:01:34Z")

</div>

Sure,

This line tweens(moves) a sprite called mummy from the current x(px from left) position to the game’s width plus 1600 pixles plus the current x of the mummy. It does this tween in 20 seconds or 20,000 milliseconds. It uses no easing (smoothing of the tween or effects), and it starts the tween right away(the true on the end)

game.add.tween(mummy).to({ x: game.width + (1600 + mummy.x) }, 20000, Phaser.Easing.Linear.None, true);  
game.add.tween(object\_to\_tween).to({ x: target\_x }, time\_in\_milliseconds, easing, startNow);

object\_to\_tween:sprite or image

the {x:target\_x} could be an object with a number of properties such as {x:100,y:200,alpha:0}  
The tween will gradually adjust these values from the sprite’s current property to the target\_values

Does that make sense?

---

<div class="post-metadata">

**Author:** ![BigSalade](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@BigSalade](https://phaser.discourse.group/u/BigSalade)\
**Post date:** [January 6, 2019, 11:03pm UTC](https://phaser.discourse.group/t/hey-i-have-a-line-of-code-that-i-dont-understand-solved/618/3 "2019-01-06T23:03:33Z")

</div>

yes it does thank you very much this was very helpful
