# I need help making a script for jumping on and killing enemies

**URL:** <https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208>\
**Category:** Help\
**Tags:** game\
**Created:** [February 16, 2022, 10:35pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208 "2022-02-16T22:35:15Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![StickNick](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@StickNick](https://forum.makecode.com/u/StickNick)\
**Post date:** [February 16, 2022, 10:35pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/1 "2022-02-16T22:35:15Z")

</div>

So basically I am coding a sonic game, I have programmed the enemies movements and Sonic’s. my only issue is that I need a way to kill the enemy, can someone give me suggestions or try to fix please?

Game page: [https://makecode.com/\_Lgp0a8PEk5Ds](https://makecode.com/_Lgp0a8PEk5Ds)

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 21, 2022, 11:55pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/2 "2022-02-21T23:55:11Z")

</div>

but i hope you like it although it wont change level

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 21, 2022, 11:55pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/3 "2022-02-21T23:55:28Z")

</div>

this is reallly good 😃 you should look at my sonic game and maybe we could collaborate to make a reallly cool sonic game. i like the animations and the enemies look perfect as well as the trees background ad flowers

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 22, 2022, 5:27pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/4 "2022-02-22T17:27:03Z")

</div>

> **[green hill zone current](https://arcade.makecode.com/91883-32582-34827-59970)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

here is mine ,kinda seems like a downgrade of yours

---

<div class="post-metadata">

**Author:** ![StickNick](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@StickNick](https://forum.makecode.com/u/StickNick)\
**Post date:** [February 25, 2022, 5:29pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/5 "2022-02-25T17:29:09Z")

</div>

Thank you! also yeah we should collab! I looked at your game and it looks amazing with the title cards and such. By the way, do you have a way on helping me code a way to kill enemies?

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 25, 2022, 6:58pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/6 "2022-02-25T18:58:47Z")

</div>

Yes so basically you go on the when sprite if a player overlapped the enemy and within that block you have an if statement wich has if then sonic sprites vy(velocity y)=0 then change life or use my ring loss thing so it gets hurts and then for the if else then you put destroy other sprite so basically if you jump on the enemy it’ll die but if it goes into you you get hurt

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 25, 2022, 6:59pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/7 "2022-02-25T18:59:02Z")

</div>

But for collaborating do you think that I could delete all my work on mine so the pallete is kept then start a new with new discussed Game stuff and I convert some if your tiles onto my game and we can use the gif converter to use sonic mania sprites and try and make slopes and loops and that and use certain parts of each other’s to make an ultimate accurate sonic game

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 25, 2022, 6:59pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/8 "2022-02-25T18:59:07Z")

</div>

So basically like transport all of our stuff into one game but some stuff different

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 25, 2022, 7:48pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/9 "2022-02-25T19:48:57Z")

</div>

Sorry for loads of posts but I think that we should maybe make a next level of chemical plant zone and that and also how did you make the music cause I used the rtttl extension for mine

---

<div class="post-metadata">

**Author:** ![StickNick](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@StickNick](https://forum.makecode.com/u/StickNick)\
**Post date:** [February 26, 2022, 2:22am UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/10 "2022-02-26T02:22:57Z")

</div>

Yes we could, but it may be a little difficult, considering I don’t know how to transfer code. But we can take turns adding new scripts and sharing new builds so that we can build upon what we have so far. Originally my game was a mini version of sonic 1. Also yes the music was done by me, using a piano note guide.

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 28, 2022, 4:20pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/11 "2022-02-28T16:20:31Z")

</div>

Ahh ok I’m not too sure on how to transfer code either I think you just go onto JavaScript copy it and paste it but you have to have the same variables kinda and that

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [February 28, 2022, 4:23pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/12 "2022-02-28T16:23:26Z")

</div>

And just wondering would you want to base this game on the neo geo pocket sonic as thatsbwhat I used my sonic animations from but if you want to keep your sonic animations I know how to make it like where your sonic could follow my taller sprite like tails does sorta like a sonic generations thing

---

<div class="post-metadata">

**Author:** ![StickNick](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@StickNick](https://forum.makecode.com/u/StickNick)\
**Post date:** [February 28, 2022, 8:25pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/13 "2022-02-28T20:25:48Z")

</div>

Hmm, well we can revamp the neo Geo sprites, like add tweaks or improvements, but I like my green hill tilesets, and I added a waterfall tilesets which looks cool 🙂

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [March 1, 2022, 6:16pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/14 "2022-03-01T18:16:34Z")

</div>

I do like your green hill zone tile set maybe we could merge both our tiles together

---

<div class="post-metadata">

**Author:** ![StickNick](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@StickNick](https://forum.makecode.com/u/StickNick)\
**Post date:** [March 7, 2022, 5:14pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/15 "2022-03-07T17:14:44Z")

</div>

okay, lets try :D, i currently have a new build of my game (but its laggy)

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [March 8, 2022, 5:27pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/16 "2022-03-08T17:27:37Z")

</div>

Same I completely restarted mine and it looks so epic

---

<div class="post-metadata">

**Author:** ![StickNick](https://avatars.discourse-cdn.com/v4/letter/s/cdc98d/32.png) [@StickNick](https://forum.makecode.com/u/StickNick)\
**Post date:** [March 22, 2022, 6:50pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/17 "2022-03-22T18:50:00Z")

</div>

May I see?

---

<div class="post-metadata">

**Author:** ![Segatendo](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Segatendo](https://forum.makecode.com/u/Segatendo)\
**Post date:** [March 23, 2022, 4:04pm UTC](https://forum.makecode.com/t/i-need-help-making-a-script-for-jumping-on-and-killing-enemies/12208/18 "2022-03-23T16:04:46Z")

</div>

search sonic 2 remake on the forum and there it is 🙂
