This project has been deleted.
A shooter game with different abilities. Made using pygame in python and was my first python game it made. The game has multiple powerups and gets harder the longer you play.
Powerups:
Speed Boost - q
Rapid Fire - 1
Shield - 2
Each powerup lasts 5 seconds
You can collect hearts to gain back health
Move using the "wasd" keys and use you mouse to aim and shoot (left click to shoot)
To run code, export code from github and run the test.py file in preferred code editor / python idle
or
run replit below:
Game link here: https://replit.com/@KushRay/pyshooter
* In replit, the first time you have to run the program, then go to the developer page and click run VNC output. This should open a VNC tab where you can see and run the game. The first run may be buggy, so once you open the VNC the first time, just re-run the program to play the game. Directions are above.
BnaJns
Check their projects out: slack.fm, readmefm, BnaJns Portfolio, roblox-outfit-finder, faucet - a c++ http server, visittallinn-waffles, ralseibot
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
Fixed a few bugs and uploaded the code to replit so it can be run on any computer without downloading and running the file locally.
This session, I worked on adding a status bar to my powerups, so it visually shows how long you have for each powerup. I used the same logic I used to make the health bar to do this. Next up, add a counter so you can't spam the powerups (make it so you need to acquire powerups before using them).
this session, I added a shield powerup. This was relatively easy, and I also added a new sprite with a shield look that updates when the shield is active. I got the code to work by adding to the if statements, that health is only lost if the sheaf condition is false. Next up, add visual timers for the powerups.
I spent this session making a health boost. I started by making a sprite and drawing it onto the screen at a random spot. I then used the collision detection logic from before to increase the health when the player collects the heart. I then spend the most time making it so the heart would appear randomly at random time intervals. I used the pygame.time.get_ticks() function, but that led to some bugs. I managed to fix it by adding a second condition so the if command only runs once (and is more accurate). I finally got it to work, with the heart randomly appearing at random times, and giving +1 health when collected. Next up, adding a shield powerup (or something else?).
I added a powerup this session. I added an ability to rapid fire for five second on the press of a key. The main problem i faced was the time limit, since I already used a time function for another ability. This time, I had to make another variable for the time to make this work. I also had to redefine the bullet to make sure it appeared on the screen and acted correctly. I also spent some time playing around to see what else I can do to add spice to the game. (For example, I played around with changing the screen size as a power up). Next up, more powers, or adding limits to using powers. (or other pickup able things).
This session, I added a health bar. I used the draw function to make a rectangle, and changed the width of the rectangle based on the health value. I also positioned the health bar so it follows right above the player. Then I added an end screen if you lose all your health. I made so it shows Game Over and then your final score. I also made it so the health bar only shows once you take damage. Next up, making the game harder and more adaptive (and possible adding more abilities).
In this session, I added text to the screen to show the score. I started by using a new file to test how to add text, and then incorporated the code into my game file. I changed the size, color, and layering so the score is shown as part of the background. I also made it so the score increases every time you hit an enemy. Next up, adding a health bar.
This session, I added collision detection to my game. I started by trying to use masks, but that was too complicated and did not work. Instead, I decided to use make a rect for each object and detect that. The main problem I faced was detecting all items in a list, no just the latest one. I fixed this by adding the detection in the action in creating each object (using a nested loop). After detecting collision for the projectile and enemy, I coded it for both that projectile and enemy to disappear. I used the same logic to detect player/enemy collision and remove the enemy if that happens. (with some troubleshooting so it detects at all times). In the end, I got the collision detection to work and applied actions if collision is detected. Next up, adding code to change score/health and display them on the screen.
I worked on adding enemies to my game. I then made it so the enemy will always follow the player around. I also made it so the enemies randomly spawn inside the screen. Then, using the lists I learned about last time, I made a list to spawn a certain number of enemies at a time, all of them following the player. Next up, add collision detection for taking and dealing damage.
This session, I worked on adding a projectile. I started by drawing a simple circle, and coded it to appear on the position of the player when I press a key. Then I used trig to code the projectile to move toward the mouse. Since I am new at python, I worked step by step, first making a circle, then changing the location, then moving it, then aiming it. I also drew it multiple times to add a blur effect. I wanted to make multiple projectiles, so doing some research, I learned about lists. I learned how to use a list and made one to launch multiple projectiles. I updates the code and tweaked a few things and finally got multiple projectiles that launch at the mouse.
I replaced the circle with a custom made sprite. Then I had to figure out how to rotate the sprite to face my mouse. After doing this, I wanted to add powerups. I wrote a script that increases the speed of the player after pressing q. I wanted it to only last a few seconds, and after some research how to do that, I was able to accomplish a powerup activated for a limited time. Next up, add a projectile to launch.
I started making my first python game. This is the first time I am making a game in python, so it is taking some time to learn the mechanics. I manages to make a screen and player, and move the player using the wasd keys. I also set a boundary so the player does not leave the screen. Next up, make a sprite and rotate it.