# Combo sword attack?

**URL:** <https://forum.makecode.com/t/combo-sword-attack/18481>\
**Category:** Help\
**Tags:** game\
**Created:** [March 16, 2023, 10:40pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481 "2023-03-16T22:40:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [March 16, 2023, 10:40pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/1 "2023-03-16T22:40:42Z")

</div>

Hey there! I’m new on the forums but not new to makecode and I was wondering if there was any extentions or tactics I could use for a combo sword attack. I wanted to know so I could make a Metroidvainia rouglike similar to Dead Cells

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [March 16, 2023, 10:43pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/2 "2023-03-16T22:43:35Z")

</div>

There is a ‘button combinations’ extensions you can find in the extensions tab!

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [March 16, 2023, 10:54pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/3 "2023-03-16T22:54:08Z")

</div>

There is the button combination extension. If what you mean is like A+B or B+ up key.

---

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [March 17, 2023, 12:38am UTC](https://forum.makecode.com/t/combo-sword-attack/18481/4 "2023-03-17T00:38:02Z")

</div>

Both great suggestions but I have already tried those. I need some way of making an attack that has multiple parts. Here is an example  
 ![Example](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a506853489cfc15fd63470cb814fb682fef6001d.gif) I realize i’m being pretty vauge with my question, but there isn’t really a way to say it, its something that needs to be seen.

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [March 17, 2023, 1:27am UTC](https://forum.makecode.com/t/combo-sword-attack/18481/5 "2023-03-17T01:27:25Z")

</div>

You could set a combo variable, like so

```auto
if(Combo == 1){
    DoComboSlash1()
    Combo++
} else if (Combo == 2){
    DoComboSlash2()
    Combo++
} else if (Combo == 3){
   DoComboSlash3()
   Combo = 1
}

```

---

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [March 17, 2023, 4:18pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/6 "2023-03-17T16:18:41Z")

</div>

Is there any way to do this in blocks? (I’m not that good at Java and Python is a foreign languge to me 😅)

---

<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:** [March 17, 2023, 4:24pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/7 "2023-03-17T16:24:01Z")

</div>

Not sure if this applies to Makecode, but the way I did a combo mechanic in another game engine using timers and the logic basically goes like this:

1. When hitting the attack button, player will attack (using the first combo move) and a timer will go off.
2. If the player hits the attack button during the timer, the second move in the combo will happen.
3. If not, the player will have their combo move counter set to 1 again, meaning that when they attack again they will use the first combo move.
4. Again for 2, if the player hits the attack button during the second timer then the 3rd combo will occur and so on.

basically: when u attack, a timer goes off and if u attack while the timer is going then you can continue the combo. if not, then the combo restarts.

---

<div class="post-metadata">

**Author:** ![SOCKMONSTER12](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sockmonster12/32/7584_2.png) [@SOCKMONSTER12](https://forum.makecode.com/u/SOCKMONSTER12)\
**Post date:** [March 17, 2023, 4:30pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/8 "2023-03-17T16:30:36Z")

</div>

Yes I agree with @PixelDoodle and you could also use percents with different animations for each percent.

---

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [March 18, 2023, 1:45am UTC](https://forum.makecode.com/t/combo-sword-attack/18481/9 "2023-03-18T01:45:03Z")

</div>

Thanks dudes! I will Upload the game in spurts. Expect to see the start up tommorow.

---

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [March 20, 2023, 5:18pm UTC](https://forum.makecode.com/t/combo-sword-attack/18481/10 "2023-03-20T17:18:49Z")

</div>

Okay “A Travler’s Tale” has officially kicked off as my latest project! Here’s the opening! (please do not use for your own game!) [A Travlers Tale](https://arcade.makecode.com/S14728-83020-24404-45899)
