Skip to content

Commit

Permalink
Reorganize files
Browse files Browse the repository at this point in the history
  • Loading branch information
erilyth committed Dec 9, 2016
1 parent a50197d commit a2dd3a9
Show file tree
Hide file tree
Showing 110 changed files with 6 additions and 88 deletions.
Binary file renamed model0.keras → Current_Model_Pool/model_new0.keras
Binary file not shown.
Binary file renamed model1.keras → Current_Model_Pool/model_new1.keras
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Current_Model_Pool/model_new26.keras
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Current_Model_Pool/model_new40.keras
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Current_Model_Pool/model_new45.keras
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Current_Model_Pool/model_new48.keras
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
FlappyBirdClone
===============

A Flappy Bird Clone made using [python-pygame][1]

How-to
------

1. Install Python 2.7.X from [here](https://www.python.org/download/releases/)

2. Install PyGame 1.9.X from [here](http://www.pygame.org/download.shtml)

3. Clone this repository: `git clone https://github.com/sourabhv/FlappyBirdClone.git` or click `Download ZIP` in right panel and extract it.

4. Run `python flappy.py` from the repo's directory

5. use <kbd>&uarr;</kbd> or <kbd>Space</kbd> key to play and <kbd>Esc</kbd> to close the game.

(Note: Install pyGame for same version python as above)

(For x64 windows, get exe [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame))

ScreenShot
----------

![Flappy Bird](screenshot1.png)

[1]: http://www.pygame.org
# Flappy Bird Genetic Algorithm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions flappy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
IMAGES, SOUNDS, HITMASKS = {}, {}, {}

load_saved_pool = 1
save_current_pool = 1
current_pool = []
fitness = []
total_models = 50
Expand All @@ -31,7 +32,7 @@

def save_pool():
for xi in range(total_models):
current_pool[xi].save_weights("model_new" + str(xi) + ".keras")
current_pool[xi].save_weights("Current_Model_Pool/model_new" + str(xi) + ".keras")
print("Saved current pool!")

def model_crossover(model_idx1, model_idx2):
Expand Down Expand Up @@ -83,7 +84,7 @@ def predict_action(height, dist, pipe_height, model_num):

if load_saved_pool:
for i in range(total_models):
current_pool[i].load_weights("model_new"+str(i)+".keras")
current_pool[i].load_weights("Current_Model_Pool/model_new"+str(i)+".keras")

for i in range(total_models):
print(current_pool[i].get_weights())
Expand Down Expand Up @@ -429,7 +430,8 @@ def showGameOverScreen(crashInfo):
for select in range(len(new_weights)):
fitness[select] = -100
current_pool[select].set_weights(new_weights[select])
save_pool()
if save_current_pool == 1:
save_pool()
generation = generation + 1
return

Expand Down
Binary file removed model_new18.keras
Binary file not shown.
Binary file removed model_new45.keras
Binary file not shown.
Binary file removed model_new48.keras
Binary file not shown.
Binary file removed screenshot1.png
Binary file not shown.
36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

0 comments on commit a2dd3a9

Please sign in to comment.