# I am making an Elden RIng type game. I am working on short invincibility for dodging, and don't quite know how to do that

**URL:** <https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394>\
**Category:** Help\
**Created:** [April 17, 2026, 5:47pm UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394 "2026-04-17T17:47:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![H3llish\_port](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/h3llish_port/32/31121_2.png) [@H3llish\_port](https://forum.makecode.com/u/H3llish_port)\
**Post date:** [April 17, 2026, 5:47pm UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/1 "2026-04-17T17:47:00Z")

</div>

Could you help?

---

<div class="post-metadata">

**Author:** ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)\
**Post date:** [April 17, 2026, 9:13pm UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/2 "2026-04-17T21:13:02Z")

</div>

Those are called “i frames” in games! There are 2 ways that I know of:

> **Way 1**
>
> When the player dodges, you can set an “i frames” variable to a number (bigger value = longer invisibility). In an “on game update” or “forever” loop, add a “change (i frames) by (-1)”. Then, whenever the enemy attacks, only let the player get attacked when the “i frames” variable isess than it equal to 0 (if \<(i frames) \<= (0)\> then). If done right, it should not get hurt when dodging!

> **Way 2**
>
> when the player starts to dodge, set the players SpriteKind to something like DodgingPlayer. when the enemy attacks, it fiirst checks if the players kind is Player, and if not, attack. (if \<((player) kind) == ([Player])\> then). in the [timers extension](https://github.com/microsoft/arcade-timers), use the “after (…) do” (bigger number = longer invincibility) block to set the player’s kind back to Player.

---

<div class="post-metadata">

**Author:** ![Iro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/iro/32/34749_2.png) [@Iro](https://forum.makecode.com/u/Iro)\
**Post date:** [April 18, 2026, 2:12am UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/3 "2026-04-18T02:12:53Z")

</div>

should be pretty easy, you just need to set the damage trigger to only damage the player when the variable == (something, like 1), and whenever the player dodges, just set the variable to 0, then when they are done dodging, set it back to 1 (and if you don’t want the player to just keep dodging and become invulnurable, just set a cooldown between dodges). hope that helped 😁 .

---

<div class="post-metadata">

**Author:** ![H3llish\_port](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/h3llish_port/32/31121_2.png) [@H3llish\_port](https://forum.makecode.com/u/H3llish_port)\
**Post date:** [April 18, 2026, 2:53am UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/4 "2026-04-18T02:53:13Z")

</div>

I am familiar with invincibility frames, and came up with this, and I’m not sure if it works. Thank you for reaching out to help!

 ![Screenshot_20260417-185309](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/3/63851cbabcef4043ee07b38ce840d8fcef5f481d.png)

---

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [April 18, 2026, 2:57am UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/5 "2026-04-18T02:57:51Z")

</div>

When the player hits the dodge button, make the sprite ghost through walls like below

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/f/5fb1b76af204b5627f743e02eefe6fd7719d3be5.png)

that way any other sprites touching that sprite will not affect or deal dammage.

---

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [April 18, 2026, 8:40pm UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/6 "2026-04-18T20:40:11Z")

</div>

Instead of pause, use the timer extension

---

<div class="post-metadata">

**Author:** ![H3llish\_port](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/h3llish_port/32/31121_2.png) [@H3llish\_port](https://forum.makecode.com/u/H3llish_port)\
**Post date:** [April 19, 2026, 2:23am UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/7 "2026-04-19T02:23:26Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![H3llish\_port](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/h3llish_port/32/31121_2.png) [@H3llish\_port](https://forum.makecode.com/u/H3llish_port)\
**Post date:** [April 19, 2026, 2:23am UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/8 "2026-04-19T02:23:32Z")

</div>

Which block should I use? I’m a week into makecode, and I’m not quite familiar with the timers extension.

---

<div class="post-metadata">

**Author:** ![CodingGrizzlyBear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codinggrizzlybear/32/14838_2.png) [@CodingGrizzlyBear](https://forum.makecode.com/u/CodingGrizzlyBear)\
**Post date:** [April 19, 2026, 9:42pm UTC](https://forum.makecode.com/t/i-am-making-an-elden-ring-type-game-i-am-working-on-short-invincibility-for-dodging-and-dont-quite-know-how-to-do-that/43394/9 "2026-04-19T21:42:57Z")

</div>

After () do

is better than pause, but if you don’t know how, then you can do pause
