How to make x and y varables

I just found this and Im used to scratch code so I was wondering how do I make x and y varables to make it more simple for my character movements.

3 Likes

Welcome to the Makecode forums! When you create sprites using the built in sprite stuff, they already have x and y variables assigned to them, as well as a bunch of other stuff:


All that stuff is near the top of the Sprites block tab! :)

One way to x and y variables that I know is, going to the Variables tab and creating two variables. Then, name the variables “x dir” and “y dir” then you can controller projectiles based on the way you are facing in your game I will send one of my games where I did this for more information .

Not sure what you wan’t, but in sprite you should see stuff to set y/x velocity and such. You may be able to take the x and y variables out of the blocks in the sprite area.

oh thank you guys so much