Skip to content

Commit 52f7717

Browse files
author
XenGi
committed
controller can/must now be killed with pymlgame like pygame.quit(). fixed the mate light sizes to the prefered one for the upcoming instalation.
1 parent 5f5cb60 commit 52f7717

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

emulator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Emu(object):
2828
"""
2929
The Emulator is a simple pygame game.
3030
"""
31-
def __init__(self, width=40, height=40, ip='127.0.0.1', port=1337):
31+
def __init__(self, width=50, height=28, ip='127.0.0.1', port=1337):
3232
"""
3333
Creates a screen with the given size, generates the matrix for the
3434
Mate bottles and binds the socket for incoming frames.
@@ -99,4 +99,4 @@ def gameloop(self):
9999

100100
if __name__ == '__main__':
101101
EMU = Emu()
102-
EMU.gameloop()
102+
EMU.gameloop()

game_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,5 @@ def gameloop(self):
141141

142142

143143
if __name__ == '__main__':
144-
GAME = Game('127.0.0.1', 1337, 40, 40)
145-
GAME.gameloop()
144+
GAME = Game('127.0.0.1', 1337, 50, 28)
145+
GAME.gameloop()

pymlgame/controller.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ def get_events(self):
115115
ret.append(self.queue.pop(0))
116116
return ret
117117

118+
def quit(self):
119+
"""
120+
Kill the Controller process.
121+
"""
122+
self.t._stop()
123+
118124

119125
class Event(object):
120126
"""

0 commit comments

Comments
 (0)