Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
se3xa3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hameed Andy
se3xa3
Commits
170094ae
Commit
170094ae
authored
6 years ago
by
Hameed Andy
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://gitlab.cas.mcmaster.ca/hameea1/se3xa3
parents
e5af3971
91440a2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
BlankProjectTemplate/src/Snake_Game.py
+5
-4
5 additions, 4 deletions
BlankProjectTemplate/src/Snake_Game.py
BlankProjectTemplate/src/highscore.py
+4
-3
4 additions, 3 deletions
BlankProjectTemplate/src/highscore.py
with
9 additions
and
7 deletions
BlankProjectTemplate/src/Snake_Game.py
+
5
−
4
View file @
170094ae
#importing necessary libraries
import
pygame
,
sys
import
highscore
class
GUI
():
#a function made to execute other files from the system
def
runfile
(
runfilename
):
...
...
@@ -49,8 +49,8 @@ def main():
if
(
10
<=
mousepos
[
0
]
<=
310
and
550
<=
mousepos
[
1
]
<=
550
+
55
):
GUI
.
button
(
game
,[
200
,
0
,
0
],[
10
,
550
,
300
,
55
],
0
)
if
mouseclick
[
0
]
==
1
:
GUI
.
runfile
(
'
highscore.py
'
)
#
highscore.main()
#
GUI.runfile('highscore.py')
highscore
.
main
()
else
:
GUI
.
button
(
game
,[
180
,
180
,
180
],
[
10
,
550
,
300
,
55
],
0
)
GUI
.
text
(
'
HIGHEST SCORE
'
,
"
comicsansms
"
,
35
,(
0
,
0
,
0
),(
10
,
550
),
game
)
...
...
@@ -67,7 +67,8 @@ def main():
pygame
.
display
.
update
()
main
()
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
BlankProjectTemplate/src/highscore.py
+
4
−
3
View file @
170094ae
import
pygame
,
sys
from
tkinter
import
*
import
Snake_Game
class
HighScore
():
def
runfile
(
runfilename
):
...
...
@@ -38,7 +38,8 @@ def main():
HighScore
.
text
(
'
Main Menu
'
,
"
times
"
,
25
,
red
,(
90
,
70
),
highscore
)
if
(
90
<=
mousepos
[
0
]
<=
90
+
120
and
70
<=
mousepos
[
1
]
<=
70
+
27
):
if
mouseclick
[
0
]
==
1
:
HighScore
.
runfile
(
'
Snake_Game.py
'
)
#HighScore.runfile('Snake_Game.py')
Snake_Game
.
main
()
HighScore
.
button
(
highscore
,[
0
,
0
,
0
],
[
125
,
105
,
45
,
27
],
0
)
HighScore
.
text
(
'
Quit
'
,
"
times
"
,
25
,
red
,(
125
,
105
),
highscore
)
...
...
@@ -49,4 +50,4 @@ def main():
pygame
.
display
.
update
()
main
()
#
main()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment