Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e00473b
adding project proposal markdown
nathanestill Mar 6, 2018
43f8fb0
Added a document of things to keep in mind
coreyacl Mar 6, 2018
26cfbd1
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
coreyacl Mar 6, 2018
6dd5a2c
Updated things to keep in mind
coreyacl Mar 6, 2018
ea5e719
Adding Base Asteroid file
nathanestill Mar 6, 2018
9f29142
adding Asteroid picture
nathanestill Mar 6, 2018
7a28eee
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
nathanestill Mar 6, 2018
5876bfa
adding Asteroids and Going back and forth
nathanestill Mar 7, 2018
0e3a95a
Begin file for interface
coreyacl Mar 7, 2018
eea708b
adding BlackScreen
nathanestill Mar 7, 2018
12d4976
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
coreyacl Mar 7, 2018
d050675
Added spawning of multiple asteroids
nathanestill Mar 7, 2018
1729544
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
nathanestill Mar 7, 2018
c17e415
Add functions for UI interaction
coreyacl Mar 8, 2018
59b16ba
adding comments
nathanestill Mar 9, 2018
ab2cb15
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
nathanestill Mar 9, 2018
abbe146
Fix ship movement mechanics
coreyacl Mar 9, 2018
bf12349
deleting black screen and adding CollectionOfAsteroids
nathanestill Mar 9, 2018
ffd6f05
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
nathanestill Mar 9, 2018
bd64cf3
Modidy interface.py and add classes.py
coreyacl Mar 11, 2018
42697de
added projectile class
nathanestill Mar 11, 2018
2d7fe2a
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
nathanestill Mar 11, 2018
4a142b3
added comments
nathanestill Mar 12, 2018
1c6dbdf
starting to add UFOs and added comments on most of the classes and fu…
nathanestill Mar 13, 2018
82502dc
Finish movement
coreyacl Mar 13, 2018
1957138
finished UFO code
nathanestill Mar 14, 2018
1657a21
Fix movment for ship
coreyacl Mar 14, 2018
1d88a51
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
coreyacl Mar 14, 2018
8817e88
adding asteroid, projectile, and UFO to classes.py
nathanestill Mar 14, 2018
116c7a9
adding UFO.gif
nathanestill Mar 14, 2018
874098b
Integrate asteroids and interface
coreyacl Mar 14, 2018
4db39d4
added shooting
nathanestill Mar 14, 2018
24ba29b
added shooting at a certain rate of fire
nathanestill Mar 14, 2018
1c9ce85
added destroy function and code to call it in Allthings
nathanestill Mar 14, 2018
b7ebeb8
added some comments to Asteroids
nathanestill Mar 14, 2018
048aa9f
simple bug fix with the projectile distance
nathanestill Mar 14, 2018
c4e2efa
adding in lives
nathanestill Mar 15, 2018
18f6015
added ship moving back to spawn location. still needs to be invulnera…
nathanestill Mar 15, 2018
9887277
Add score and lives to GUI
coreyacl Mar 15, 2018
ffbbcd1
added invulnerability frames
nathanestill Mar 15, 2018
da72f74
added invulnerability frames
nathanestill Mar 15, 2018
c5e1c47
Start markdown file for reflection
coreyacl Mar 15, 2018
34b55ed
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
nathanestill Mar 15, 2018
af75542
partially added hitbox shrinking
nathanestill Mar 15, 2018
4dd4096
fixed ship hit box
nathanestill Mar 16, 2018
bd3e1e8
added a ton of headers to all my functions and classes that I should …
nathanestill Mar 16, 2018
856925f
added Results markdown
nathanestill Mar 16, 2018
ef29c75
Add GAMEOVER screen
coreyacl Mar 16, 2018
cabaf93
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
coreyacl Mar 16, 2018
d5729cd
adding my implementation
nathanestill Mar 16, 2018
25b6cd4
Updated project reflection
coreyacl Mar 16, 2018
a364533
made a few changes to the reflection
nathanestill Mar 16, 2018
949fa3f
Updated reflection
coreyacl Mar 16, 2018
d3844de
adding my design choice and how to play
nathanestill Mar 16, 2018
64e3756
Changed main to qbert.py
coreyacl Mar 16, 2018
c704c51
Merge branch 'master' of https://github.com/coreyacl/InteractiveProgr…
coreyacl Mar 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Asteroid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
396 changes: 396 additions & 0 deletions Asteroid.py

Large diffs are not rendered by default.

Binary file added FullGame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions ProjectProposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Main Idea
The main idea is to create the game "Asteroids". We will explore classes and the pygame library and generate a playable game at the end. Our MVP is having a controllable rocket ship and asteroids that move around and can be shot. Our strectch goal is adding the UFOs.

### Learning Goals
Corey: To learn how user-game interactions work as well as UI.
Nathan: To learn how the pygame library works, and explore its functions.

### Libraries
We plan to use mostly pygame for our project, and also random and math. We don't think we will need any other libraries for this project.

### Mid-Project Check-in
We will make an arena and a a player that shoots.

### Biggest Risks
Underestimating the amount of time it will take to complete the game and other tasks.
40 changes: 40 additions & 0 deletions ProjectReflection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Project Reflection
### Authors: Corey Cochran-Lepiz, Nathan Estill

## Project Overview

We created a Pygame version of the classic arcade game, Asteroids.

## Results

      We ended up with a game that does a good job resembling the original game. The player starts with three lives. They have a ship that moves with an acceleration and turning based system. The ship slows down when not accelerating and can "drift" when turning while going forward. Colliding with asteroids or UFOs, or getting hit by the UFOs projectile makes the player lose a life. The ship shoots a projectile that goes about 5/8 of the size of the screen. Hitting other objects with the ship's projectiles grants points depending on the object. No other interactions grant points. For every 10000 points the player receives, another life is granted.

      The asteroids spawn in random places around the map and break up when hit with a non-asteroid object. They break up twice into two more smaller asteroids and disappear on the third hit. Large asteroids are worth 20 points, medium asteroids are worth 50 and small asteroids are worth 100. The UFOs spawn randomly throughout the game. They move in either a straight line or a in a up and down fashion. They shoot in random directions at a distance that is lower than that of the Ship's projectiles. UFOs can shoot asteroids and hit asteroids, but does not grant points if destroyed in this manner. The UFO is worth 500 points.
![A screen shot of the game working](FullGame.png)

## Implementation [~2-3 paragraphs + UML diagram]
      Our implementation for the non-controllable objects consisted of making a class for each object. Each class had an update function that handled the movement of the object and a destroy function, for when the object was destroyed. The asteroid and UFO had subclasses that inherited them, one for each size of asteroid, and one for each type of asteroid (We had initially planned to add a second type of UFO, but ran out of time). Each of these classes had an overarching class that contained all of the instances of the lower class. This made collision detection much easier and allowed us to simply update the greater class, which in turn updated all of the instances. There was one class that contained all of the objects in the game, holding the overarching classes for each object. This class handled collision detection and updated all of the objects.

      On the design choices. For the Ship class we decided to go with Pygame's rotation function which was tricky since each time it rotates an image it loses overall quality. Another route we could have gone is making a folder with every angle of the ship inside of it so that all it had to do was pull from the folder when we called for a rotation instead of modifying an image each time. Another design choice we made was to connect surfaces to rectangles that approximately represented their shape. We could have made many smaller rectangles to more accurately represent the shape of the object, but we decided that it wasn't worth the additional time spent. The estimated hit boxes are close enough, and the additional accuracy would have made an insignificant improvement.

Class Diagram
* listOfObjects - contains and keeps track of all objects
* CollectionOfAsteroids - contains and keeps track of all asteroids
* Asteroid - Base Asteroid class
* Small Asteroid - Inherits from Asteroid
* Medium Asteroid - Inherits from Asteroid
* Large Asteroid - Inherits from Asteroid
* CollectionOfUFOs - contains and keeps track of all UFOs
* UFO - Base UFO class
* BigUFO - Inherits from UFO
* SmallUFO (not implemented) - Inherits from UFO
* CollectionOfProjectiles - contains and keeps track of all Projectiles
* Projectile - Base Projectile class
* Ship - kept all data for the player
* GUI - in charge of all user interface realated things

## Reflection [~2 paragraphs]
<!-- The thing below is to indent. It's HTML basically -->
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Looking back at the project we both felt like it was a great success. We feel like the project was scoped well for where our skill levels are. We weren't completely comfortable going into it but at the same time we didn't spend hours on hours debugging code. At the beginning of the project we sat down one dinner with a white board to talk about the overarching design goals we had for the project, written [here](keepInMind.md), which was a great start as it meant we had laid out the project as well as all of the responsibilities. We decided to go with the 'divide and conquer' approach alongside meeting every few days to work next to each other for a few hours which turned out to be an effective strategy for us. We wish we had brainstormed ways to go above and beyond with the project early on so that we could have implemented them from the start. One of the ideas being a two-player Asteroids where one person drives and another aims and shoots a canon.

Looking back, we could have made a lot more of the classes inherit from each other. We could have made a class that was a basic object that moved in space that all of the other objects could have inherited from. We also could have made a class that the could have been a base for all of the 'collection' classes that would have made that part go smoother.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# InteractiveProgramming
This is the base repo for the interactive programming project for Software Design, Spring 2018 at Olin College.
run python3 interface.py
How to play:
Up key: Move the ship forward
Left/Right Key: rotates the ship
Space Bar: Shoot (can be held down)
Q: quits the game

Cheat Codes:
R: Rapid Fire Mode (Toggle)
L: Add life
Binary file added UFO.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading