how to make snap movements

for my college assignment I’m making a 2d scroller where the main character moves through gates collecting coins, and i need my character to snap movements up and down, is there anyway to do that?

What do you mean by snap movements? Do you mean the player moves in specific increments? If so, you could just have your keyboard trigger move the player in one block increments (32 pixels).