for a side-scrolling 2d game, you just need to import a sprite into the game engine and add a script to program its movement which is fairly standard stuff. you’ll need to read the engine’s API on what function to call to read player input, its different for each engine; then, change the value of the position of the sprite if the input is pressed and boom, you have a moving character.
i second Godot as a lightweight and free open-source engine that is extremely robust, powerful and elegant in its design. it’s one of the best from a software engineer’s perspective. if you want something that fits your use-case 100%, check out Pico-8 although it isn’t free and it uses Lua. at the end of the day, i’d still recommend Godot.