winapi (win32) Space Invader Game (How do I shoot a bullet)

Asked 2 years ago, Updated 2 years ago, 132 views

I've been thinking about it for about 8 hours, but I can't solve it, so I'm posting a question.

Like the title, I'm making a space invader game in winapi (win32).

If you press the space bar, a bullet will be fired from the player located at the bottom of the center, so please tell me how to get to the end of the screen

I did enemy using a setimer() but I don't know how to use a bullet ㅠ<

Enemy operation:

The 10*5 enemy in the center moves to the right If it hits the wall, it moves to the y-axis by +40 and then moves back to the other side. (Repeat continuously)

(cf. No. 1, No. 2, No. 3 bullets are just floating shapes that don't move.)

I have to shoot bullets and deal with collisions, but there's a long way to go

c++ winapi win32

2022-09-20 20:17

1 Answers

You can create multiple timers, not just one.

I heard that you used a timer to process the movements of the enemy.

Create another timer for the bullet and process the bullet there.


2022-09-20 20:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.