Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b70ae97
location. py is the function indicating the site of pathogen, and imp…
Subeen-Kim Oct 19, 2017
c40af24
Version 1 Skeleton UI
jwen2 Oct 22, 2017
086c735
Added Click Interaction
jwen2 Oct 23, 2017
104e084
Virus Draft - RAW
victorbianchi Oct 23, 2017
2cc94cd
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
victorbianchi Oct 23, 2017
d61d10c
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
Subeen-Kim Oct 23, 2017
b2a41e0
1st trial about time and input handling
Subeen-Kim Oct 23, 2017
a913dc0
Added Time and Pause Botton on Bottom Right
jwen2 Oct 23, 2017
8486919
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
jwen2 Oct 23, 2017
bbf1fd4
Country Population Database
victorbianchi Oct 25, 2017
b80dbf4
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
victorbianchi Oct 25, 2017
262f5c1
Attempting to Add Circle Interaction
jwen2 Oct 26, 2017
7fdce31
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
jwen2 Oct 26, 2017
4273f42
UI Screen Change Test - Press C to Change Screens/Run Functions
jwen2 Oct 26, 2017
558de66
Useful File
jwen2 Oct 27, 2017
20379d8
new virus format with gorgeous time stuff
Subeen-Kim Oct 27, 2017
db39c83
propagation and death types are added
Subeen-Kim Oct 27, 2017
d73f897
Added display for total infected/total pop. Fixed Initial Infection
jwen2 Oct 29, 2017
95155e0
Added title screen and instructions
jwen2 Oct 29, 2017
16cbf96
modification about death stops at 5
Subeen-Kim Oct 29, 2017
a11db98
Added rounds function
vtbianchi Oct 29, 2017
741f559
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
vtbianchi Oct 29, 2017
d8be63f
now it stops at zero
Subeen-Kim Oct 29, 2017
7e115a0
Upgrade points is updated
Subeen-Kim Oct 29, 2017
f49c50c
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
Subeen-Kim Oct 29, 2017
0a42179
Added End Game Screen
jwen2 Oct 29, 2017
6fd3c15
Added upgrade possibility
vtbianchi Oct 29, 2017
1fae333
I modified Upgrade_Point into linear function
Subeen-Kim Oct 30, 2017
4e5d19a
death rate modified
Subeen-Kim Oct 30, 2017
6b59ba4
ReadMe File
vtbianchi Oct 30, 2017
d5c9fd7
Read Me File
vtbianchi Oct 30, 2017
1d851ea
Added upgrades
vtbianchi Oct 30, 2017
6086d69
Added Upgrade Points Box, Slow'd down points gain, Fixed upgrade cost
jwen2 Oct 30, 2017
ef209e0
documentation is improved
Subeen-Kim Oct 30, 2017
a2e05c5
Wirte-up and Reflection file
Subeen-Kim Oct 30, 2017
3cb86bd
Reflection
vtbianchi Oct 30, 2017
b2326b7
Added doctor and cure funtionality, Fixed death bug (stuck at 15), ad…
jwen2 Dec 9, 2017
9a12fb2
Merge branch 'master' of https://github.com/jwen2/InteractiveProgramming
jwen2 Dec 9, 2017
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
48 changes: 48 additions & 0 deletions UI_Skeleton.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
""" John Wen"""

import pygame
import os

# class powerupbox(object):
# def __init__(self, x0, x1, y0, y1):
# self.x0 = x0
# self.x1 = x1
# self.y0 = y0
# self.y1 = y1

pygame.init()

background_color = (255,255,255)
RED = (255,0,0)
width, height = 640, 480

screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Plague Simulation')
screen.fill(background_color)
RECT1 = pygame.Rect(600,440,40,40)

running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
""" circles represent classes for now"""
pygame.draw.circle(screen, RED, (300,200),38)
pygame.draw.circle(screen, (0,255,0), (150,250),36)
pygame.draw.circle(screen, (0,0,255), (200,450),30)
""" Black box will be sending you to upgrade screen"""
pygame.draw.rect(screen, (0,0,0), RECT1)
"""Red Rectangle will display time"""
pygame.draw.rect(screen, (RED), [300,0,600,40])
pygame.display.update()

if event.type == pygame.MOUSEBUTTONDOWN:
click = RECT1.collidepoint(pygame.mouse.get_pos())

if click == 1:
print ('CLICKED!')

click2 =


pygame.quit()
118 changes: 118 additions & 0 deletions Virus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
"""
Victor Bianchi - SoftDes MP4 - Fall 2017 - Plague.BETA
This code is a basic structure to
the Virus class of the infamous game, Plague.
Figuring the different game mechanics and mathematics behind the virus
Has proven to be difficult.
RAw code does not compile and only represents the basic structure
the game should implement.
"""

class Virus():

#Class constants and to reset game
WORLD_POPULATION = 7 000 000 000
INITIAL_INFECTION_RATE = 1.05
HEALTHY_POPULATION = WORLD_POPULATION
SICK_POULATION = 0
DEAD_POPULATION = 0.99999 #To account for natural deaths

#We should have an external CSX/XML file
#to load the different countries
#User should be able to choose between a country, a random country in
#a continent or Random.
countries_set = set(Canada, United States, Mexico)#and others
first_infected;

def new_plague(self, first_inefected = None):
"""Creates new virus"""

infection = INITIAL_INFECTION_RATE

first_country = input('Choose starter country by entering country name or type Random')

#with open (file, 'countries_list') as f:
#for input in f:
while input in countries_set or input == 'Random':
if first_country in countries_set:
return input
else #first_country == 'Random':
first_country = random.choice(countries)

print('Please try again')
new_plague()

if first_infected is None:
#start infection
healthy = HEALTHY_POPULATION - 1
sick = SICK_POPULATION + 1
#start new round()

def new_round():
""" THis function initiates the new round"""
rounds = 0
#9 different upgrade variables
#Can be converted to a list later on
t0 = 0;
t1 = 0;
t2 = 0;
s3 = 0;
s4 = 0;
s5 = 0;
a6 = 0;
a7 = 0;
a8 = 0;

print('Would you like to increase transmission, symptoms, or the diseases abilities ?'')
round_user_choice = input('Type T, S, A, or hit the space bar to skip')

#Increase transmission = 0, 1, 2,
if input == 'T':
upgrade_choice == input("Would you like to increase airborne, rodent based, meat based tramission")
if upgrade_chocie.islower() == 'airborne':
return t0++
elif upgrade_choice.islower() == 'rodent':
return t1++
elif upgrade_choice.islower() == 'meat':
return t2++
#Increase Symptoms = 3, 4, 5
elif input == 'S':
if upgrade_chocie.islower() == 'insanity':
return t3++
elif upgrade_choice.islower() == 'necrosis':
return t4++
elif upgrade_choice.islower() == 'inflammation':
return t5++
#Increase abilities = 6, 7, 8
elif input == 'A':
if upgrade_chocie.islower() == 'drug':
return t6++
elif upgrade_choice.islower() == 'cold':
return t7++
elif upgrade_choice.islower() == 'hereditary':
return t8++
#Skip round
elif input == ' ':

else:#user error
print('Try again')

rounds += 1

def infection_upgrade(t0,t1,t2,s1,s2,s3,s4,s5,a6,a7,a8):
#for every upgrade made to a variable, increase coefficient by x
#Ex: 1.00 -> 1.05 -> 1.1

def infection_length():
#This function will define how long it takes for someone to die after getting infected

def infect():
#This function constantly infects people, can happen between each round
#SICK_POPULATION * INFECTION_RATE


#4 Upgrades for 3 categories
#Transmission (airborne, rodent based, meat based)
#Symptoms(insanity, necrosis, inflammation )
#Abilities (drug resistance, cold resistance, hereditary )
#Increase infection rate