Game Programming – Assignment day 15
|
Fixed Gamestate now, when the game starts you go into the gamestate by writing ”new” into the console and press enter, you exit by pressing escape. Upon exiting the gamestate you are taken back to the console and can write ”new” again to start a new gamestate. You can also write ”quit” in the console to exit the program altogether. When pressing space a bullet objects gets positioned right above the player object. Received some help to get the ”isDOWNonce” function to work properly, now it reads a key once instead of taking inputs continuously. UPDATE: Made a bullet vector to store bullet objects in. Need to use an iterator to go through the vector and draw sprites for each object in it. It’s not working yet due to the fact that I’m unfamiliar with the syntax used with iterators, I need to learn it.
UPDATE 2: With help to learn the syntax I’ve managed to make bullets work. Now a new bullet spawns every time SPACE is pressed, it moves upwards and gets its sprite drawn out. The only problem now is that they now exist until the program is closed so the next step is to fix a cleanup/delete function for them |