Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
36 changes: 36 additions & 0 deletions Time.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Subeen Kim
Input handling & time
"""
import pygame, time

pygame.init()
pygame.display.set_mode((400,300))
pygame.display.set_caption('Mouse Input Test')

"""pause untile frames_per_sec has passed"""
clock = pygame.time.Clock()
frames_per_sec = 30

"""
Input Handling
pygame.event.wait() : sit and block further game execution until an events comes along
pygame.event.poll() : will see whether there are any events wating for processing
pygame.evnet.get() : returns all of the currently-outstanding events
"""

playtime = 0
running = True
while running:
seconds = clock.tick(frames_per_sec)//30
playtime += seconds

for event in pygame.event.get():
if event.type == QUIT:
running = False
if event.type == KEYDOWN and event.key == K_ESCAPE:
running = False
if event.type == MOUSEBUTTONDOWN:
print (event.button)

pygame.display.quit()
62 changes: 43 additions & 19 deletions UI_Skeleton.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
""" John Wen"""
""" John Wen
Time runs in milliseconds, (1000 = 1 second)
"""

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
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

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

UpgradeMenu = pygame.Rect(600,440,40,40)
Timelocation = pygame.Rect(400,0,600,40)
Populationlocation = pygame.Rect(0,440,300,400)
"""Timer"""
Time = 0
ActiveTime = True
font = pygame.font.SysFont('Consolas', 30)


clock = pygame.time.Clock()



running = True
while running:
Expand All @@ -29,20 +44,29 @@
""" 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)
pygame.draw.circle(screen, (0,0,255), (200,350),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())
pygame.draw.rect(screen, (0,0,0), UpgradeMenu)
"""Time Display"""
pygame.draw.rect(screen, (0,0,0), Timelocation)
"""Country Population Display"""
pygame.draw.rect(screen, (0,0,0), Populationlocation)
"""timer display"""
screen.blit(font.render(str(pygame.time.get_ticks()/1000), True, (255, 255, 255)), (400, 0))

if click == 1:
print ('CLICKED!')
pygame.display.update()

click2 =

if event.type == pygame.MOUSEBUTTONDOWN:
if UpgradeMenu.collidepoint(pygame.mouse.get_pos()):
if pygame.time.get_ticks() > (Time + 1000):
Time = pygame.time.get_ticks()
if ActiveTime == True:
pygame.time.wait(2000)
Time - 1001
ActiveTime = False
else:
ActiveTime = True

""" Compare last time clicked"""
pygame.quit()
Empty file added import.py
Empty file.
9 changes: 9 additions & 0 deletions location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def location(x,y):
x1 = x - 20
x2 = x + 20
y1 = y - 20
y2 = y + 20

indication = ImageDraw.Draw(img)
indication.ellipse((x1, y1, x2, y2))
img.save('newimage2.jpg')