# Need help on difficulty

**URL:** https://forum.makecode.com/t/need-help-on-difficulty/4179
**Category:** Help
**Created:** [October 30, 2020, 5:04am UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179 "2020-10-30T05:04:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)
#### Post date: [October 30, 2020, 5:04am UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179/1 "2020-10-30T05:04:02Z")

</div>

So I’ve been working on this space shooter game and there is no difficulty increase. I have levels and different sprites for each one. Anyone know ideas on how to increase the difficulty. I was thinking to make the velocity of the enemyShips faster and faster through the game,  
but I dont really imagine how I could do that. Maybe this? ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/e/ede2eb349ce33eb3da92d0d0e203a91d90a6260c.jpeg)  
I don’t think this would work though because I don’t have anything set like velocity x and y to enemySpeed and position x and y to spawntime, so I am guessing I have to speed the enemy off this  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/3008e7a5a20b904e2e2ba9ccf602bd55a15f29ec.png)  
I was going the make the enemy shoot projectiles but still couldn’t think of that.

---

<div class="post-metadata">

### Author: ![SPerkins25](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SPerkins25](https://forum.makecode.com/u/SPerkins25)
#### Post date: [October 30, 2020, 4:10pm UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179/2 "2020-10-30T16:10:08Z")

</div>

> **[Enemy shooting](https://arcade.makecode.com/68520-73792-09985-87175)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Making enemies shoot is sort of tricky. From what I’ve done in the past it involves using the sprite data extension to store your enemies x and y position so that the enemy projectiles can be told where to spawn from.

Making enemies move quicker is easier. You just need to have a variable control the enemies yv. You could have the variable increase by 20 every 10 seconds or so.

---

<div class="post-metadata">

### Author: ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)
#### Post date: [October 30, 2020, 6:12pm UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179/4 "2020-10-30T18:12:07Z")

</div>

When I tried it on my code, it was working for the enemy sprites but the player sprite’s projectile was shooting downwards instead of up (I am in a top-down space shooter). So pretty much the other enemies behind them (top) are getting hit by these bullets. Plus, I couldn’t think of a way to increase the vy variable by 20 every how many seconds I want.

---

<div class="post-metadata">

### Author: ![SPerkins25](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@SPerkins25](https://forum.makecode.com/u/SPerkins25)
#### Post date: [October 30, 2020, 6:24pm UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179/5 "2020-10-30T18:24:04Z")

</div>

Oh sorry I realised I used the generic projectile type which would be your players lasers too! Make a new type for enemy projectiles and it should be good.

For enemy speed, make a variable to control it (EnemySpeed). On start set the EnemySpeed variable to 100. Inside a forever loop stick a change EnemySpeed variable by (X) and a pause (X)ms block. Then use this new variable block inside the enemy’s yvel.

---

<div class="post-metadata">

### Author: ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)
#### Post date: [October 30, 2020, 7:28pm UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179/6 "2020-10-30T19:28:14Z")

</div>

Ah, I see. It counts the all projectile as well, I just changed both slots to enemyProjectile so it only fired from variable enemy. I am trying out and testing speed, will get back to you soon.

---

<div class="post-metadata">

### Author: ![Satisfaction](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Satisfaction](https://forum.makecode.com/u/Satisfaction)
#### Post date: [October 30, 2020, 10:57pm UTC](https://forum.makecode.com/t/need-help-on-difficulty/4179/7 "2020-10-30T22:57:09Z")

</div>

Cool stuff. EnemyProjectiles work and the enemySpeed as well! I had a pick random block on my yvelocity so i swapped that out with the enemySpeed variable and now… i can set a certain yvelocity and change it ever so often milli-seconds! Thank you for your help! ;D
