# Dynamic code in the update function?

**URL:** <https://phaser.discourse.group/t/dynamic-code-in-the-update-function/9734>\
**Category:** Phaser 3\
**Created:** [June 4, 2021, 4:57pm UTC](https://phaser.discourse.group/t/dynamic-code-in-the-update-function/9734 "2021-06-04T16:57:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodingAvenger](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/codingavenger/32/5256_2.png) [@CodingAvenger](https://phaser.discourse.group/u/CodingAvenger)\
**Post date:** [June 4, 2021, 4:57pm UTC](https://phaser.discourse.group/t/dynamic-code-in-the-update-function/9734/1 "2021-06-04T16:57:22Z")

</div>

I was wondering if anyone has experimented with the user building their own story, or moving the character using a code generator like Google’s Blockly?

I was wondering if there is an example of the update function being changed during runtime and then the character/game updating?

I’m new to Phaser, but I really like what I’m seeing so far - thanks!

---

<div class="post-metadata">

**Author:** ![CodingAvenger](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/codingavenger/32/5256_2.png) [@CodingAvenger](https://phaser.discourse.group/u/CodingAvenger)\
**Post date:** [June 4, 2021, 7:33pm UTC](https://phaser.discourse.group/t/dynamic-code-in-the-update-function/9734/2 "2021-06-04T19:33:00Z")

</div>

I got it figured out with the “eval(code);” function. Pretty simple.
