# Transform

**URL:** <https://forum.makecode.com/t/transform/13224>\
**Category:** Arcade\
**Created:** [April 22, 2022, 9:25pm UTC](https://forum.makecode.com/t/transform/13224 "2022-04-22T21:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Starfox2k](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@Starfox2k](https://forum.makecode.com/u/Starfox2k)\
**Post date:** [April 22, 2022, 9:25pm UTC](https://forum.makecode.com/t/transform/13224/1 "2022-04-22T21:25:33Z")

</div>

What would be the code if i wanted to make a mario game. where when touching  
an item / food, would make him transform into a fiery mario. Change the animation  
for like 10 seconds or so. Or when an enemy touches him, the mario sprite  
reverts back to original form? SUPER NOOB HERE. LOL

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [April 25, 2022, 5:05pm UTC](https://forum.makecode.com/t/transform/13224/2 "2022-04-25T17:05:43Z")

</div>

Hey there, welcome!

This is very easy to implement and all you need to do is set 2 variables: 1 for regular and 1 for power-up. In the Game Update block, write:

If regular:  
[Character Animations (Extension) blocks for your character]  
else if power-up:  
[Same Character Animations (Extension) blocks for your character, but a fiery version as you said]

And to implement the mechanics, in the overlap block, write:

set regular = false  
set power-up = true  
After 10000, (Timer extension block)  
set power-up false  
set regular true

And in the enemy overlap code, write:

if power-up:  
set power-up = false  
set regular = true  
(deal damage code if you want)  
else:  
(deal damage code)

The main thing here is that if the power-up variable is true, the regular must be false, and vice versa.

Hope this helps!
