well thanks for all your help lactose , I am sorry you have given up on me,
drawing sprites
Maybe try writing some small tools to make life easier.
For example I once took a trip on a train and took hundreds of photos with my camera set up on a tripod on the table. What I hadn't realized until I got home was that I had just caught the left hand size of the window frame in all the shots, which I didn't want. Rather than spend a lot of tedious time going through and cropping 15 pixels out of hundreds of photos, I wrote a small tool to do it for me.
I'm not really sure on what advice to give you at this point other than to just to make sure you ask clear questions and keep trying.
If you want to try to continue this Space Invaders project and you still want to try to add in some kind of delay, then at this point I recommend you abandon using the chrono::high_resolution_clock object for the time being and use the sleep function instead. The original advice you received against using it was given under the assumption that you were doing something else. If all you're trying to do is just make it look like your sprites are moving around, you may not need the sleep function anyways depending on what amount you're moving the sprites.
thanks kseh, I am reading a college level text book on c++ and doing the exercises in the backs of the chapters, maybe this will help to understand the fundamentals of programming in c++. This is very large text so it will take some time to get through it. however I will still will work on my space invaders game. I will try to use the sleep function instead.
kseh I give up on space invaders it is just too hard, instead I am working on a tank based combat game
38 minutes ago, phil67rpg said:kseh I give up on space invaders it is just too hard, instead I am working on a tank based combat game
Because that'll be so much easier than space invaders...
Space Invaders, Tank Combat, whatever you choose to do, you're going to have to learn how to do a game loop correctly, so you might as well just stick it out.
2 hours ago, phil67rpg said:kseh I give up on space invaders it is just too hard, instead I am working on a tank based combat game
Here are the things needed for a space invaders game:
Receiving input from the player
Tracking and moving the player
Tracking and moving enemies
Tracking and moving bullets
Running enemy logic
Drawing everything
Using timers to ensure same speed across different machines
Here are the things needed for a tank game:
Receiving input from the player
Tracking and moving the player
Tracking and moving enemies
Tracking and moving bullets
Running enemy logic
Drawing everything
Using timers to ensure same speed across different machines
See the pattern? The reason you haven't been able to do space invaders is because you haven't been able to do all of the basic parts, but you need to be able to do those to do a tank game as well. Constantly changing projects when things become difficult is not how to learn. It's just finding a new brick wall to throw yourself at.