Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point display #16

Open
wants to merge 129 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
5d0a7a0
Update README.md
sunsky426 Jul 19, 2022
5a6e581
Seperated Action & Direction
sunsky426 Jul 19, 2022
40dc4ed
Added Enum.py
sunsky426 Jul 19, 2022
20e0b2c
Merge branch 'chrehall68:main' into main
sunsky426 Jul 19, 2022
ffe87a3
Added comments and simplified a few things
m325th Jul 19, 2022
f6b6d68
Merge branch 'main' of https://github.com/sunsky426/SGAI-DRHAT-Outbreak
m325th Jul 19, 2022
683b5ce
Merge branch 'main' into impl_act
sunsky426 Jul 19, 2022
ccc355b
Edited stuff
sunsky426 Jul 20, 2022
3c3f27b
finish implementing heal
sunsky426 Jul 20, 2022
1b5bb9f
Update main.py
sunsky426 Jul 20, 2022
3a8f8c7
deleted action_space and direction_space
sunsky426 Jul 20, 2022
45c3882
Add Intermission
sunsky426 Jul 20, 2022
f5c3f72
Implement case when vaccined person heals a zombie
sunsky426 Jul 20, 2022
297bae1
messed with pygame a bit
m325th Jul 20, 2022
d415e0f
added basic framework and UI for kill action
rtsej Jul 20, 2022
2c83e19
Update PygameFunctions.py
m325th Jul 20, 2022
bc5d8d8
Added kill function
sunsky426 Jul 20, 2022
cd5677e
Merge branch 'impl_heal' into impl_kill_ui
sunsky426 Jul 20, 2022
43016a5
Impl backend for kill
sunsky426 Jul 20, 2022
966f254
unused import
sunsky426 Jul 20, 2022
ad419ff
Update PygameFunctions.py
m325th Jul 20, 2022
797b8da
stuff
sunsky426 Jul 20, 2022
8e7768d
stuff
sunsky426 Jul 20, 2022
abd33f3
Added constants.py
sunsky426 Jul 20, 2022
0a34f57
bruh
sunsky426 Jul 20, 2022
49fe63c
added bite.png
sunsky426 Jul 20, 2022
0abee3a
finalized
sunsky426 Jul 20, 2022
7b1afc0
Merge branch 'main' into impl_kill_ui
sunsky426 Jul 20, 2022
571a331
Merge pull request #3 from sunsky426/impl_kill_ui
sunsky426 Jul 20, 2022
a26d55c
added action.kill for computer
sunsky426 Jul 20, 2022
caa811b
B vs Board bs GameBoard sycronization
sunsky426 Jul 20, 2022
44eca1b
Impl bite for fail heal
sunsky426 Jul 21, 2022
64349d1
fixed pop and zombies
m325th Jul 21, 2022
38eeb19
cleaning
m325th Jul 21, 2022
ecb7dc6
Update State.py
m325th Jul 21, 2022
702eb35
Merge branch 'fix_spawning' of https://github.com/sunsky426/SGAI-DRHA…
m325th Jul 21, 2022
407c80c
Update constants.py
m325th Jul 21, 2022
971f2d8
fix spawing
m325th Jul 21, 2022
6aa0982
Merge pull request #4 from sunsky426/fix_spawning
sunsky426 Jul 21, 2022
b86ced2
Update README.md
sunsky426 Jul 21, 2022
ff14622
fix constant capitalization
alisonding357 Jul 22, 2022
b61819c
Implements basic main menu
rtsej Jul 22, 2022
47d3fc1
Merge branch 'main' into impl_main_menu
sunsky426 Jul 22, 2022
5bbdaa6
change comment
sunsky426 Jul 22, 2022
88b42e5
added sound effect for kill
alisonding357 Jul 22, 2022
c3d55ac
Update Constants.py
alisonding357 Jul 22, 2022
cd23aa3
add visual for safespace (bad)
sunsky426 Jul 22, 2022
1e17b04
safespace backend
sunsky426 Jul 22, 2022
7c79f75
Update PygameFunctions.py
rtsej Jul 22, 2022
a1168ba
Merge branch 'impl_safe_space' of https://github.com/sunsky426/SGAI-D…
rtsej Jul 22, 2022
43409c1
bruh
sunsky426 Jul 25, 2022
893f5b6
Merge branch 'main' into impl_safe_space
sunsky426 Jul 25, 2022
da394e8
Merge pull request #5 from sunsky426/impl_safe_space
sunsky426 Jul 25, 2022
4646d14
Merge branch 'main' into impl_main_menu
sunsky426 Jul 25, 2022
14a5388
Merge pull request #6 from sunsky426/impl_main_menu
sunsky426 Jul 25, 2022
391f022
Update main.py
sunsky426 Jul 25, 2022
50e8f2b
moved files out of SGAI_MK3
m325th Jul 25, 2022
2c52a53
nerfed safeSpaces
m325th Jul 25, 2022
e56c4f3
add Dir.self
sunsky426 Jul 25, 2022
62027f4
add facing
sunsky426 Jul 25, 2022
9baedc4
Update Constants.py
sunsky426 Jul 25, 2022
8f0d0c3
fixed zombies moving into safe spaces and added computer_role to board
m325th Jul 25, 2022
6fb3390
add role param to all actions and fix move action using role param
m325th Jul 25, 2022
ca0ffe7
Update main.py
sunsky426 Jul 25, 2022
380ffb9
Merge pull request #7 from sunsky426/nerf_safeSpaces
sunsky426 Jul 25, 2022
4ee1bf0
bugfix
sunsky426 Jul 25, 2022
e0bb0fe
stuff
sunsky426 Jul 25, 2022
8e3b1a8
updated win/lose screens
rtsej Jul 25, 2022
6daf67d
bugfix
sunsky426 Jul 25, 2022
68a9104
index renamed
sunsky426 Jul 25, 2022
20dca89
Merge branch 'main' into impl_end_screen
sunsky426 Jul 25, 2022
e52f754
Merge pull request #8 from sunsky426/impl_end_screen
sunsky426 Jul 25, 2022
1ae3623
Merge branch 'main' into impl_dir
sunsky426 Jul 25, 2022
c22cb62
Merge pull request #9 from sunsky426/impl_dir
sunsky426 Jul 25, 2022
ff9208d
bugfix
sunsky426 Jul 25, 2022
192b27a
impl_hasMed
sunsky426 Jul 25, 2022
3885d36
fix a ton of stuff
m325th Jul 25, 2022
58a0789
add point system
alisonding357 Jul 25, 2022
552ec73
display score on win scrreen
alisonding357 Jul 25, 2022
00ceb95
bruh
sunsky426 Jul 25, 2022
0458356
Merge branch 'main' into point_display
sunsky426 Jul 25, 2022
d5fd8fd
get rid of SGAI_MK3 Folder
alisonding357 Jul 26, 2022
9f8aae0
impl_Result
sunsky426 Jul 26, 2022
57c9a28
bruh
sunsky426 Jul 26, 2022
e601da9
Merge branch 'point_display' of https://github.com/sunsky426/SGAI-DRH…
sunsky426 Jul 26, 2022
83ea6b8
brooo
sunsky426 Jul 26, 2022
965166f
Update Board.py
m325th Jul 26, 2022
88ecb29
Update Board.py
m325th Jul 26, 2022
dc18e4e
Update Constants.py
m325th Jul 26, 2022
231d2d2
Merge pull request #10 from sunsky426/fix_vax
m325th Jul 26, 2022
e4fdc26
Update Board.py
m325th Jul 26, 2022
152ed4f
Merge pull request #12 from sunsky426/fix_vax
alisonding357 Jul 26, 2022
a498fc2
Revert "Update Constants.py"
m325th Jul 26, 2022
427bafb
Update Board.py
m325th Jul 26, 2022
48421c8
Merge branch 'main' of https://github.com/sunsky426/SGAI-DRHAT-Outbreak
m325th Jul 26, 2022
f9296ea
Update constants.py
sunsky426 Jul 26, 2022
4aaba58
Merge branch 'main' into sound_effects
sunsky426 Jul 26, 2022
3c46980
Merge branch 'main' of https://github.com/sunsky426/SGAI-DRHAT-Outbreak
m325th Jul 26, 2022
84978d7
Amongus
sunsky426 Jul 26, 2022
55c481f
Amongus
sunsky426 Jul 26, 2022
3bf5cd6
Amongus
sunsky426 Jul 26, 2022
9000e0e
Merge pull request #15
diabrar Jul 26, 2022
0875a58
Merge branch 'main' of https://github.com/sunsky426/SGAI-DRHAT-Outbreak
m325th Jul 26, 2022
ffdab29
Update Constants.py
m325th Jul 26, 2022
5fbfa4c
lowercased from commit import
m325th Jul 26, 2022
aa5c50c
Merge pull request #16 from sunsky426/fix_constants_import
diabrar Jul 26, 2022
d13fd3d
added public opinions
sunsky426 Jul 26, 2022
6fd8a6b
add_tanh
sunsky426 Jul 26, 2022
5433c41
change Sigmoid function from tanh to smoothstep
sunsky426 Jul 27, 2022
a8a0d12
decrease amount of zombies
sunsky426 Jul 27, 2022
32580eb
impl smoothstep
sunsky426 Jul 27, 2022
fb17aa1
reset public opinion
sunsky426 Jul 27, 2022
9508a38
Merge branch 'main' into public_opinion
sunsky426 Jul 27, 2022
80fae58
point change amount adjustment
sunsky426 Jul 27, 2022
3b94ca8
Merge branch 'main' into impl_hasMed
sunsky426 Jul 27, 2022
d666fa4
Merge pull request #17 from sunsky426/impl_hasMed
sunsky426 Jul 27, 2022
1d2cb77
decrease amount of zombies
sunsky426 Jul 27, 2022
d2f2cec
delete useless import statement
alisonding357 Jul 27, 2022
530883d
bugfix
sunsky426 Jul 27, 2022
88aac16
Merge branch 'public_opinion' of https://github.com/sunsky426/SGAI-DR…
sunsky426 Jul 27, 2022
bbe5759
Update Constants.py
sunsky426 Jul 27, 2022
6cf6415
change casing
sunsky426 Jul 27, 2022
8b9ca1e
Merge branch 'main' into point_display
sunsky426 Jul 27, 2022
e0e89c1
added Result class
sunsky426 Jul 27, 2022
ae318c0
Added Result class
sunsky426 Jul 27, 2022
ecec0cd
change import
sunsky426 Jul 27, 2022
ed5b716
change elseif bug
sunsky426 Jul 27, 2022
0fb5c83
Merge pull request #21 from sunsky426/public_opinion
sunsky426 Jul 27, 2022
1b8fd97
added Result class
sunsky426 Jul 27, 2022
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
File renamed without changes.
Binary file added Assets/Kill sound.mp3
Binary file not shown.
Binary file added Assets/Outbreak_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/RedCross.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/bite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added Assets/kill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
496 changes: 496 additions & 0 deletions Board.py

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions Constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import enum
import pygame
import os
pygame.mixer.init()


ROWS = 6
COLUMNS = 6
BORDER = 150 # Number of pixels to offset grid to the top-left side
CELL_DIMENSIONS = (100, 100) # Number of pixels (x,y) for each cell
SELF_PLAY = True # whether or not a human will be playing
KILL_SOUND = pygame.mixer.Sound(os.path.join('Assets', 'Kill sound.mp3'))

class Action(enum.Enum):
move = 1
bite = 2
heal = 3
kill = 4

class Direction(enum.Enum):
self = 0
up = 1
down = 2
left = 3
right = 4

class Role(enum.Enum):
government = 0
zombie = 1

class Result(enum.Enum):
invalid = 0
success = 1
failure = 2

reverse_dir = {
Direction.up: Direction.down,
Direction.down: Direction.up,
Direction.left: Direction.right,
Direction.right: Direction.left
}
4 changes: 4 additions & 0 deletions SGAI_MK3/Person.py → Person.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import random as rd

from constants import Direction


class Person:
def __init__(self, iz: bool):
self.facing = Direction.up
self.isZombie = iz
self.wasVaccinated = False
self.turnsVaccinated = 0
self.isVaccinated = False
self.wasCured = False
self.hasMed = False

def clone(self):
ret = Person(self.isZombie)
Expand Down
Loading