- Created test file to try and figure out renderer. Texture sprites seem fairly nonviable unless I want to go back and change how I make every single sprite in the game. May have to do this for text.
- Considered making text sprites in separate files and just uploading as sprites. This is what I did for text in my game dev class :^) That might be a cop-out, though. It would certainly allow me to progress past this annoying text phase, at least, because I could use my normal sprite renderer.
Work for Monday 6/19
Work for Friday 6/16
- Working on getting text functioning.
- Created texture render system but didn't actually use it, because it created an error. Will try to get it working later, but for now just made a basic SDL_Renderer to run into the text creation function.
- Currently segfaulting somewhere in the text creation function, but can't figure out where.
- Time: 3 hours
- Total Time: 12 hours
Work for Wednesday 5/14
- Changed collision system to be based off two points rather than whole square. Swept collision is still messed up- because the lower left point is in the back for player bullets and the front for enemy bullets, it was messing up collisions. I ended up taking it out for now.
- Got clearing the screen to work by removing enemies from array. Turned out I needed to render the world again after I cleared the list.
Total time: 2 hours
Work for Monday 5/12 and Tuesday 5/13
Monday:
- Created lives system for ship and game over
- Read up on text rendering: one method involves using the SDL_ttf library, which is included (I think) so I will probably use this one. Need to figure out if the software renderer in the code is an acceptable renderer.
- Tried to figure out how to clear the screen before ending the game, but nothing worked successfully. Will probably also need to use the software renderer for this.
- Total time: 3 hours
Tuesday:
- Still working on clearing screen and text.
- Just tried to figure out how to clear screen and text the whole time. Tried several methods.
- Total time: 4 hours
Work for Friday 5/9
- Fixed enemy bullet speed by moving it into the main update loop and not having it in the enemy update function, since it was updating for every enemy.
- Changed collision boxes so that they extend backwards conditionally based on which type of object it is. Also added slight padding around the sides of the bullets shot by the player in an attempt to stop them traveling between enemies and hitting ones in the back row. This might cause problems later, so I may add padding to the enemies instead. Needs to be tested.
- Have a pull request that needs to be committed before I can push these changes.
- Final product for the week:
Time: 1 hour
Total for week: 15 hours
Plan for next week:
Plan for next week:
- Implement scoring system, player lives and game over/win conditions
Work for Thursday 5/8
- Implemented shooting for bullets. Currently collide with player ship and disappear or fly off screen. Nothing happens to player on collision- plan on implementing lives system tomorrow.
- One weird thing is that the bullets move extremely fast even when given the same speed as the player bullets.
- Also may want to slow down bullet shooting later, but for testing purposes, have them firing pretty frequently.
- Tomorrow, I plan to try and implement a game over. After playing Space Invaders online, I saw that the player has three lives and when it is hit, the enemies freeze, the player does a little explosion animation and a sound plays, and then the position resets and the enemies resume moving from the same spot. When the player runs out of lives, the screen clears and GAME OVER shows on it, along with your score.
Time: 3 hours
Work for Wednesday 5/7
- Got alien movement working
- Currently has no stopping point and will go infinitely
- Does something where the bullet can pass between the aliens and hit ones in the back rows- I don't know if this was possible in the original Space Invaders, so I don't know if I should look for a way to fix it.
Total time: 4 hours
Work for Tuesday 5/6
- Made bullets narrower so it's more like actual space invaders
- Changed scaling on spaceship so it's set and doesn't scale with window size- the aliens are more difficult to scale since the space between them changes strangely
- Changed collision on bullets to implement swept volume
- Changed how sprites are deleted when they are hit
- Trying to set up movement- running into the problem that the enemies are not one collective object, so variables for direction, etc, can not be set in the update for loop as they change every time a new enemy is examined. I think I need to make a class for all the enemies and set things in there, but then I would need a way to check the edges of the group to see what direction to go in.
- Somehow managed to get this to happen:
Time: 4 hours
Work for Monday 6/5
- Working on getting bullets to eliminate enemies.
- Created collision checker that checks if two objects are collided.
- First problem: objects are being correctly removed from their respective lists, so other objects can move past them, but the sprites of these removed objects remain onscreen.
- Second problem: I'm not sure if I have this all happening in the correct location- I couldn't figure out another way to do it aside from putting the check in the runloop, but this seems incorrect. Because the enemy list and bullet list are created in the main method and only the individuals themselves have objects, I couldn't think of another way to remove them from their lists.
- Ended up doing this by creating a method in both the bullet and the enemy called hit that runs before it's removed from the list. This sets the sprite to width and height 0, so there isn't a sprite anymore. Then it can be safely removed.
- Tried to create pull request for this and it had been automatically merged again. Not sure why it's doing that (I have an idea I will try next time I need to commit changes), but you can check what I did by going to the most recent commit.
- Time: 3 hours
Work for Friday 6/2
- Began working on creating aliens. Added them as a drawable class. Not sure if later we want different categories of aliens, or whether we just want to have different sprites within the alien class- in that case, I can add a parameter to the class later that specifies which sprite to use.
- For now, since I'm only creating one enemy, I have a single creation statement. However, when I'm creating more, I think I'll loop to add them to a list (I don't know data structures in Python, so I'm not sure if there's any sort of 2D array I could use for each row), and increment the spacing each time by a variable so they're spaced like the actual game.
- Have implemented loop system that creates all of the alien sprites onscreen.
- Still need to find a way to fix the aspect ratio of the game so that sprites don't scale.
- I'm not sure what method to take for the scaling- port to iOS was added as a task to complete, and that has a much taller, narrower screen size than what I'm currently using. In that case, my original idea of simply having the user only input width or height and having the other scale wouldn't work, since a different ratio would be needed. In that case, I'd probably have to find a way to make only the x-size of all the sprites scale and then y-size respond to that, rather than the y-size of the screen.
Update: changed the size and spacing of aliens after checking what an actual space invaders game looks like.
Total time for today: 3 hours
Total time for week: 11 hours
Plan for next week includes:
- Implementing movement for the aliens- should move to the far right one step at a time before lowering and moving to the far left
- Implementing health for the aliens so that they can be destroyed by the bullets.
Work for Thursday 6/1
- Successfully created bullets that fire when you hit spacebar
- Adds bullets to list created in both player and main method (set main method list equal to player list, because that list is created when the player object is)
- Then run through the list in update and update for each bullet in it
- Not sure if we want a limit for how many bullets can be fired in a certain time
- Ended up limiting it to 5 bullets at a time, though this can be changed easily. Once there are aliens the limit will probably need to be lowered, but for the time being only one at a time seemed very slow.
- Somehow managed to commit my changes without making a pull request. They're all in the files on github now.
- Time: 3 hours
Work for Wednesday 5/31
- Have been trying to figure out why I'm getting an attribute error for an hour and 30 minutes now. None of my solutions have worked. I have eliminated the possibility that it has to do with the abstract class, that it's because the super classes have update methods too, and that it's because update is called higher in the code than the instantiation of the player object. Have also checked all indents (they're all spaces) and tested with them as tabs as well, as Google suggested it could be an indentation error.
- The error was finally fixed when I changed self.vx to self.sprite.vx. This would suggest to me that the self.sprite references are actually referring to the sprite in the drawable class and not the one in the player class. I'm still not sure why it wouldn't work without the .sprite part.
- Managed to fix errors with attributes, now running into error where sprite renderer takes an int instead of a float. However, the value for time is so small that converting it to an int simply returns 0, and the player doesn't move.
- When I take out world.process (the thing that has the float/int error) and simply print the position the sprite should be at, it appears correctly, however there's obviously no sprite moving since it's not being rendered.
- Ended up getting confused about NDC again.
- Worked for 4 hours today.
Work for Tuesday 5/30
- Plan for week includes getting movement working correctly based on time rather than moving a set distance per step and implementing shooting. I don't know how long this will take so that's all I'll plan for for now.
- Need to add update function to drawable, making drawable abstract, and need to move the movement updates from the movement class into this update function.
- Have moved all of the functions from movement into the Player class, however, still unsure when update needs to be called.
Subscribe to:
Posts (Atom)







