Closed marquesVF closed 8 years ago
Hey, we prefer 4 spaces to tabs. You can use autopep8 to fix that automatically.
I'll merge it now if you want, but it seems easier to fix it on your branch.
I'm gonna fixed and request another pull
I think it is ok now
I get this error when trying to place a block:
Traceback (most recent call last):
File "/home/nitori/.venv/pycraft/bin/pycraft", line 9, in <module>
load_entry_point('pycraft', 'console_scripts', 'pycraft')()
File "/home/nitori/source/python/pycraft/pycraft/main.py", line 30, in main
pyglet.app.run()
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/app/__init__.py", line 143, in run
event_loop.run()
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/app/base.py", line 136, in run
self._run_estimated()
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/app/base.py", line 175, in _run_estimated
if not platform_event_loop.step(estimate) and estimate != 0.0 and \
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/app/xlib.py", line 124, in step
device.select()
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/canvas/xlib.py", line 165, in select
dispatch(e)
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/window/xlib/__init__.py", line 900, in dispatch_platform_event_view
event_handler(e)
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/window/xlib/__init__.py", line 1212, in _event_button
x, y, button, modifiers)
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/window/__init__.py", line 1154, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/event.py", line 369, in dispatch_event
event_type, args, getattr(self, event_type))
File "/home/nitori/.venv/pycraft/lib/python3.5/site-packages/pyglet/event.py", line 365, in dispatch_event
if getattr(self, event_type)(*args):
File "/home/nitori/source/python/pycraft/pycraft/window.py", line 53, in on_mouse_press
self.gamestatemanager.peek().on_mouse_press(x, y, button, modifiers)
File "/home/nitori/source/python/pycraft/pycraft/gs_running.py", line 48, in on_mouse_press
self.world.add_block(previous, self.world.get_block(self.player.block))
TypeError: get_block() takes 1 positional argument but 2 were given
Fixed
Some general thoughts here:
These are thing for us to discuss. I only changed the structure of the actual code to support a Game State Stack approach. The game state classes should definitely be changed according with the contributors decision.
I made some changes to support Game States and made the logic code inside the Window class to be a Game State named RUNNING.