how do get moving objects in c++ and for them to move when you press a button on your keyboard?
Have you looked at this stack exchange thread?
- Create an object
- Draw it on screen
- Update it’s position
It’s not simple to just jump into. You will probably need to use a library or just mess around with text at first.
A simple exercise would be to create a 2d array and change the characters in it within a loop.
Try changing where the asterisk is, and redrawing the array within a timed loop.
Once you understand that movement is just a series of updated frames - start changing the color of the thing you are moving, or add in the controls to move it yourself, maybe put obstacles in the way and manipulate the asterisk to avoid them.