So I have been making a tiny version of ultrakill for my friend and I need to know two things. how can I add ricochet and how do I add sliding
The main issue is that the “control sprite” block sets the player’s speed every frame, so if you want the player to do any movement that isn’t controlled by the joystick, you’ll need to make your own movement system instead of using the built in one. What I would do is, in and On Game Update block, add to the player’s vx if right is held and subtract when the left is held, and don’t add / subtract if the player is past a maximum speed. Remember to apply some sort of friction when no buttons are held.
After that, movement tech is gonna be a lot of trial and error. If you want to be able to slam then slide, you could make it so that pressing down sends you flying downwards and then you can increased movement speed for a while. It’s gonna be more difficult since it’s 2D, because it’s not easy to make something feel “right”.
Ricochet is easy, you can just set the projectiles to have the flag “bounce on wall” turned on. The block with all the flags in a giant dropdown menu is somewhere in the Sprites tab. You can give each projectile a slightly random y velocity to make the bouncing more interesting if you want.
by
do you mean bounce? if so, here you go.
Explanation:
You just have to detect overlap, and the reverse the direction of it. (Note: if you use a projectile sprite, it will destroy itself, so in this example I used a regular sprite.)
what I meant in ricochet is the bullet would bounce off of another sprite and “auto target” to the closest enemy sprite(but if the enemy sprite moves it wouldn’t follow it)
Oh, you can just use the “Follow block”
Also how would I add wall hopping?
you would just turn off downward acceleration (Gravity) when it hits a wall, then turn it on on a button press.
ello me again my brain is hurting trying to make both wall hopping and a better version of double jumping work https://arcade.makecode.com/S87779-71320-26170-26739
Hi! There are many ways wall jumping and double jump can work in games, and there are many edge cases to consider. Specifically things like if you can jump up a wall infinitely, and if wall jumping restores your extra air jump or if it does nothing or even if wall jumping takes away your extra jump. I haven’t played ultrakill, so I wouldn’t know exactly how you want these to function. I will point out some fixes to your current code though, and give you a “fixed” version of the code.
This code results in the player not having gravity when they walk off a ledge without jumping. While there are ways to detect when a sprite goes from hitting the ground to not hitting the ground anymore, I think that would overcomplicate things. For my own version kinda-fixed version of your project, I’m gonna remove it.
Now that the player always has gravity, they are always “hitting the ground” when they should be, so now this line of code is incorrect and can be fixed:
And now it looks like this:
Now, you said you want double jump to work, yes? So I’ll add this bit:
Now I noticed that if you are falling down and try to use your double jump, it doesn’t work very well. This is because you are adding to the velocity instead of setting it. When you are falling down, you have positive velocity, so subtracting from the velocity (adding a negative number to it) will not end up looking correct. This also means you jump higher if you spam two jumps really quickly instead of using your double jump when you are at the top of your first jump. This is an easy fix:
Now some of your jumps aren’t possible because you needed that extra spam jump height to reach them. That can be fixed in level design, or by simply increasing the jump height, whichever one you want to do, so I won’t be fixing that. I will note that you can make the double jump more or less strong than the normal jump, which might be interesting.
Now comes the issue of wall jumps. I will assume that jumping while touching the wall should not take away your double jump, but you can easily change that by adding a “set [jump] to (0)” into the wall jump code.
Here I am simply checking if the player is hitting a wall inside the On A Button Pressed block:
Now, you’ll notice that I have also added some x velocity to the equation. This is because I like to make my sprites jump off the wall a bit. This vx movement, however, is prevented by that pesky “Move (sprite) with buttons…” block, which sets the player velocity every frame depending on the buttons being pressed. If your goal is to eventually add sliding and other movement tech, this will need to be replaced eventually anyways. Might as well be now:
That’s a lot of code! That first IF block is a clever trick I like to use. It checks if either the left button or the right button are pressed, but also that they aren’t both pressed. If neither are pressed, both will be “false” and so the check will not pass. If only one of the two are pressed, one will be “true” and the other will be “false”, so the check will pass, and if they are both pressed then they will both be “true” and so the check will not pass.
The rest is standard movement and friction code. I know there is a built in friction system, but I haven’t really used it and I don’t know how exactly it works and when it doesn’t work like I want it to. You’ll notice that there is a convenient “maxSpeed” variable for changing the maximum player speed without changing every place it is used. I should have done that same thing with the 20s everywhere, but I didn’t consider that and now I’m too lazy to change it.
Here is my version of your project:
One more thing. Right now the game feels a bit “floaty”, as if you are floating around a bit when you jump. I would recommend increasing the gravity and the jump strength. That way you’ll jump faster and fall faster, which will prevent that floating feeling.
Ello it is me again just here to post a update I have been wondering tho, is there a way to add dashing?







