Repository navigation
Project Submission #4
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
Open
iblancett
wants to merge
66
commits into
sd17fall:master
Choose a base branch
from
iblancett:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
2c87b85
Added class defintions for course and req. Req is incomplete.
sokuno222 24678e7
Added import script
iblancett a168e80
Added ideation and source folders
iblancett 42abeb2
progress on algos -- nothing working yet
iblancett 8730859
Updating graphics window script. Added incomplete mouse pressed event
sokuno222 d959455
Courses can now be made
iblancett f4556da
Commiting to resolve pull errors. Added mouse_pressed event to graphi…
sokuno222 dba8016
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
sokuno222 8976520
Made course icons
leonardoliuuu 5118db2
started game control
iblancett 2d2ea2d
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
iblancett c15d2ea
Started setting up background function for graphics.py to call. Need …
sokuno222 4933c21
Made some level icons
leonardoliuuu e4c2e94
Changed files to incorperate icon images and mouseOver function. Stil…
sokuno222 afea157
Algo implemented for game control
iblancett a786ea4
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
iblancett d0b42b6
Something didn't push
iblancett 96e4cd4
Deleted unused scripts
iblancett b133a20
Added some doctests to Gameplay and debugged
iblancett 03ad23a
Debugged some more, added ending verdict and more doctests
iblancett 459d704
added communication between gameplay and main
iblancett f273cc2
Rearranged environment images
iblancett 31a7cdb
Setup portfolio class
iblancett 163590c
changed file paths to work on Mac
iblancett 5b05cd1
Moved rendered text to setUpE. Course Image loading not working
sokuno222 30641b9
Fixed rendering error in setUpE
sokuno222 2c3120d
Readded rendering font to mouseover function
sokuno222 07ab946
Fixing text overwriting problem
sokuno222 bd1937a
Fixed text writing over itself and size
sokuno222 e183459
Moved text rendering to setUpE, Made setUpE run only once.
sokuno222 47cb257
Unpushed changes
iblancett d216f76
Changed some lines to incorporate seperate mouseClicked function
sokuno222 cf87127
Started integration
iblancett df10443
Updated graphics
iblancett a870d23
Put graphics loop in main
iblancett 3dac77b
Added userdefined events for pushing buttons to mouseClicked()
sokuno222 2435bc3
Added req to mouseClicks for button to not have been pressed before. …
sokuno222 e82a305
Added button events
iblancett 8155d51
Debug
iblancett 231df00
Fixed bugs, game is now functional, but algo needs to be optimized
iblancett 90fad98
Added the reflection
leonardoliuuu 2efaecc
Made changes to updating images
leonardoliuuu 231e65f
Added b&w course icons to show button was pressed
sokuno222 a7ed21a
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
sokuno222 453689c
fixed level algo
iblancett bc190ca
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
iblancett a8d39f8
Added b&w icons to mouseClicks so clicked icon is greyed out.
sokuno222 59af4e5
rearranged code to be more modular
iblancett 7d216f1
created calls to ending function
iblancett 6894572
Added headers
iblancett 4130462
Added course descriptions
sokuno222 5863d32
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
sokuno222 f63593d
revised project reflection
iblancett 8f2efc1
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
iblancett 646e64c
update on the portfolio image
leonardoliuuu 8bfb444
Changing color
sokuno222 6f88e50
Fixed portfolio function
iblancett 62e75c2
Update on README
leonardoliuuu 4b50ce2
Created ending.py to make text ending
sokuno222 9dcf674
Added ending files.
sokuno222 245d255
Merge branch 'master' of https://github.com/iblancett/InteractiveProg…
sokuno222 340cbe8
Added call to ending function
iblancett b96b29e
Fixed ending
iblancett 4549dc2
Got endings working, window no longer quits
sokuno222 e773ac0
Fixed typo
sokuno222 e6a9e17
Fixed icon descriptions to match the correct icons
sokuno222 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Changed files to incorperate icon images and mouseOver function. Stil…
…l need to clear screen so text goes away after not over icon.
- Loading branch information
commit e4c2e9452d072bed84c907250f8da35a9a235e23
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,64 @@ | ||
| import pygame | ||
|
|
||
| def setUpE(screen): | ||
| '''This code is to load the basic backscreen for the program. | ||
| setUpE is NOT to be run whenever the user clicks something, just at beginning.''' | ||
| #loading/scaling images (loads as S___ for start, scaled as F___ for final) | ||
| Sbee_Icon = pygame.image.load('C:/Users/sokuno/InteractiveProgramming/Ideation/Course_Icons/BeeKeeping.png') | ||
| Fbee_Icon = pygame.transform.scale(Sbee_Icon, (108, 100)) | ||
| SENM_Icon = pygame.image.load('C:/Users/sokuno/InteractiveProgramming/Ideation/Course_Icons/ENM.png') | ||
| FENM_Icon = pygame.transform.scale(SENM_Icon, (108, 100)) | ||
| SFOCS_Icon = pygame.image.load('C:/Users/sokuno/InteractiveProgramming/Ideation/Course_Icons/FOCS.png') | ||
| FFOCS_Icon = pygame.transform.scale(SFOCS_Icon, (108, 100)) | ||
| SFunRobo_Icon = pygame.image.load('C:/Users/sokuno/InteractiveProgramming/Ideation/Course_Icons/Fun Robo.png') | ||
| FFunRobo_Icon = pygame.transform.scale(SFunRobo_Icon, (108, 100)) | ||
| SMatSci_Icon = pygame.image.load('C:/Users/sokuno/InteractiveProgramming/Ideation/Course_Icons/Mat Sci.png') | ||
| FMatSci_Icon = pygame.transform.scale(SMatSci_Icon, (108, 100)) | ||
| SMechProto_Icon = pygame.image.load('C:/Users/sokuno/InteractiveProgramming/Ideation/Course_Icons/Mecho Proto.png') | ||
| FMechProto_Icon = pygame.transform.scale(SMechProto_Icon, (108, 100)) | ||
| #basic background | ||
| pygame.draw.rect(screen, (255, 255, 255), (0,10,1000,490)) | ||
| pygame.draw.rect(screen, (255, 255, 255), (0,10,1000,440)) | ||
| #icon buttons | ||
| pygame.draw.rect(screen, (255, 255, 255), (51,550,108,100)) | ||
| #pygame.image.load('BeeKeeping.png') not working yet | ||
| pygame.draw.rect(screen, (255, 255, 255), (209,550,108,100)) | ||
| pygame.draw.rect(screen, (255, 255, 255), (367,550,108,100)) | ||
| pygame.draw.rect(screen, (255, 255, 255), (525,550,108,100)) | ||
| pygame.draw.rect(screen, (255, 255, 255), (683,550,108,100)) | ||
| pygame.draw.rect(screen, (255, 255, 255), (841,550,108,100)) | ||
| #icon display | ||
| screen.blit(Fbee_Icon,(51,550)) | ||
| screen.blit(FENM_Icon,(209,550)) | ||
| screen.blit(FFOCS_Icon,(367,550)) | ||
| screen.blit(FFunRobo_Icon,(525,550)) | ||
| screen.blit(FMatSci_Icon,(683,550)) | ||
| screen.blit(FMechProto_Icon,(841,550)) | ||
| pygame.display.flip() | ||
|
|
||
| def mouseClicks(): | ||
| '''This function looks for the click of a mouse and creates an event based on where the mouse is''' | ||
| pass | ||
|
|
||
| def mouseOver(screen, font): | ||
| '''This function looks for the position of the mouse and will display text above the buttons if the mouse is hovering over the buttons''' | ||
| #icon descriptions | ||
| beeDesc = font.render("Bees?", 1, (255,255,0)) | ||
| ENMDesc = font.render("Magic", 1, (255,255,0)) | ||
| FOCSDesc = font.render("Hacker d00d", 1, (255,255,0)) | ||
| FunRoboDesc = font.render("beep boop", 1, (255,255,0)) | ||
| MatSciDesc = font.render("hm...", 1, (255,255,0)) | ||
| MechProtoDesc = font.render("Mechie Art", 1, (255,255,0)) | ||
| #if statements | ||
| (x,y) = pygame.mouse.get_pos() | ||
| if y >= 550 and y<= 655: | ||
| if x >= 51 and x<= 159: | ||
| screen.blit(beeDesc, (100, 490)) | ||
| if x >= 209 and x <= 317: | ||
| screen.blit(ENMDesc, (100, 490)) | ||
| if x >= 367 and x <= 475: | ||
| screen.blit(FOCSDesc, (100, 490)) | ||
| if x >= 525 and x <= 633: | ||
| screen.blit(FunRoboDesc, (100, 490)) | ||
| if x >= 683 and x <= 791: | ||
| screen.blit(MatSciDesc, (100, 490)) | ||
| if x >= 841 and x <= 950: | ||
| screen.blit(MechProtoDesc, (100, 490)) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To take this to the next level, consider replacing these separate variables by a list.