Skip to content

Commit 9ebf50f

Browse files
author
Ricardo Band
committed
version bump and last changes
1 parent 3a8d6b6 commit 9ebf50f

File tree

8 files changed

+20
-22
lines changed

8 files changed

+20
-22
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ use a controller with is capable of these features.
111111

112112
---
113113

114-
Have fun while playing pymlgames on Mate Light! :D
114+
Have fun while playing pymlgames on Mate Light! :D

controller_example.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ReceiverThread(Thread):
2929
"""
3030
This thread will listen on a UDP port for packets from the game.
3131
"""
32-
def __init__(self, host='127.0.0.1', port=11337):
32+
def __init__(self, host='0.0.0.0', port=11337):
3333
"""
3434
Creates the socket and binds it to the given host and port.
3535
"""
@@ -65,7 +65,7 @@ def run(self):
6565

6666

6767
class Controller(object):
68-
def __init__(self, game_host='127.0.0.1', game_port=1338, host='127.0.0.1', port=11337):
68+
def __init__(self, game_host='127.0.0.1', game_port=1338, host='0.0.0.0', port=11337):
6969
self.game_host = game_host # Host of Mate Light
7070
self.game_port = game_port # Port of Mate Light
7171
self.host = host # Host of ReceiverThread
@@ -177,11 +177,11 @@ def handle_inputs(self):
177177

178178

179179
if __name__ == '__main__':
180-
ctlr = Controller('127.0.0.1', 1338, '127.0.0.1', 11337)
180+
ctlr = Controller('127.0.0.1', 1338, '0.0.0.0', 11337)
181181
try:
182182
while True:
183183
ctlr.handle_inputs()
184184
except KeyboardInterrupt:
185185
if ctlr.uid is not None:
186186
ctlr.disconnect()
187-
pass
187+
pass

emulator.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
__copyright__ = 'Copyright 2014, Ricardo Band'
1414
__credits__ = ['Ricardo Band']
1515
__license__ = 'MIT'
16-
__version__ = '0.1.1'
16+
__version__ = '0.2.0'
1717
__maintainer__ = 'Ricardo Band'
1818
__email__ = '[email protected]'
1919
__status__ = 'Development'
@@ -101,5 +101,5 @@ def gameloop(self):
101101

102102

103103
if __name__ == '__main__':
104-
EMU = Emu()
105-
EMU.gameloop()
104+
EMU = Emu(40, 16, '127.0.0.1', 1337)
105+
EMU.gameloop()

game_example.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
__copyright__ = 'Copyright 2014, Ricardo Band'
1414
__credits__ = ['Ricardo Band']
1515
__license__ = 'MIT'
16-
__version__ = '0.1.1'
16+
__version__ = '0.2.0'
1717
__maintainer__ = 'Ricardo Band'
1818
__email__ = '[email protected]'
1919
__status__ = 'Development'
@@ -64,9 +64,7 @@ def update(self):
6464
"""
6565
Update the screens contents in every loop.
6666
"""
67-
# this is not really neccesary because the surface is black after
68-
# initializing
69-
67+
# this is not really neccesary because the surface is black after initializing
7068
self.corners.fill(BLACK)
7169
self.corners.draw_dot((0, 0), self.colors[0])
7270
self.corners.draw_dot((self.screen.width - 1, 0), self.colors[0])

pymlgame/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
__copyright__ = 'Copyright 2014, Ricardo Band'
55
__credits__ = ['Ricardo Band']
66
__license__ = 'MIT'
7-
__version__ = '0.1.1'
7+
__version__ = '0.2.0'
88
__maintainer__ = 'Ricardo Band'
99
__email__ = '[email protected]'
1010
__status__ = 'Development'
@@ -18,7 +18,7 @@
1818
_ctlr = Controller()
1919

2020

21-
def init(host='127.0.0.1', port=1338):
21+
def init(host='0.0.0.0', port=1338):
2222
"""
2323
Initialize pymlgame. This creates a controller thread that listens for game controllers and events.
2424
"""
@@ -57,4 +57,4 @@ def get_event():
5757

5858

5959
def not_initialized():
60-
print('pymlgame is not initialized correctly. Use pymlgame.init() first.')
60+
print('pymlgame is not initialized correctly. Use pymlgame.init() first.')

pymlgame/screen.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Screen(object):
1414
"""
1515
Represents the Mate Light screen and has all the drawing methods.
1616
"""
17-
def __init__(self, host='localhost', port=1337, width=40, height=16):
17+
def __init__(self, host='127.0.0.1', port=1337, width=40, height=16):
1818
"""
1919
Create a screen with default size and fill it with black pixels.
2020
"""
@@ -64,4 +64,4 @@ def point_on_screen(self, pos):
6464
if 0 <= pos[0] < self.width and 0 <= pos[1] < self.height:
6565
return True
6666
else:
67-
return False
67+
return False

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
__copyright__ = 'Copyright 2014, Ricardo Band'
1010
__credits__ = ['Ricardo Band']
1111
__license__ = 'MIT'
12-
__version__ = '0.1.1'
12+
__version__ = '0.2.0'
1313
__maintainer__ = 'Ricardo Band'
1414
__email__ = '[email protected]'
1515
__status__ = 'Development'
@@ -35,13 +35,13 @@ def read(fname):
3535
description='pymlgame is an abstraction layer to easily build games for Mate Light inspired by pygame.',
3636
long_description=read('README.md'),
3737
download_url='https://github.com/c-base/pymlgame/archive/master.zip',
38-
classifiers=['Development Status :: 3 - Alpha',
38+
classifiers=['Development Status :: 4 - Beta',
3939
'Environment :: Console',
4040
'Intended Audience :: Developers',
4141
'License :: OSI Approved :: MIT License',
4242
'Natural Language :: English',
4343
'Operating System :: POSIX :: Linux',
44-
'Programming Language :: Python :: 3.3',
44+
'Programming Language :: Python :: 3',
4545
'Topic :: Games/Entertainment',
4646
'Topic :: Software Development :: Libraries :: Python Modules'],
4747
platforms='any',

tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
__copyright__ = 'Copyright 2014, Ricardo Band'
1010
__credits__ = ['Ricardo Band']
1111
__license__ = 'MIT'
12-
__version__ = '0.1.1'
12+
__version__ = '0.2.0'
1313
__maintainer__ = 'Ricardo Band'
1414
__email__ = '[email protected]'
1515
__status__ = 'Development'
@@ -271,4 +271,4 @@ def test_trigger_button(self):
271271

272272

273273
if __name__ == '__main__':
274-
unittest.main()
274+
unittest.main()

0 commit comments

Comments
 (0)