ppb / pursuedpybear

A python game engine.
https://ppb.dev/
Artistic License 2.0
258 stars 98 forks source link

quick comments about getting started doc #269

Open elliewix opened 5 years ago

elliewix commented 5 years ago

Hi! Per request from the python educators slack, I took a quick pass through the getting started guide. It's a really good framework! Here's some initial things to ponder, with much of this being completely normal stuff that I see happening in all first drafts of this stuff. These are really quick notes, so my language is pretty terse.

Also when I tried to follow the directions I got this:

wirelessprv-10-193-173-45:pbb_test wickes1$ python3 -m venv .venv
Error: Command '['/Users/wickes1/Documents/pbb_test/.venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

I used a conda env and it worked that way. However, the final thing just has the window open and close, and the sprite doesn't appear to move.

Here's my traceback:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/Users/wickes1/anaconda/envs/py3pbb/lib/python3.7/site-packages/ppb/events.py", line 76, in __event__
    meth(bag, fire_event)
TypeError: on_update() takes 2 positional arguments but 3 were given

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/wickes1/Documents/pbb_test/main.py", line 11, in <module>
    ppb.run(setup = setup)
  File "/Users/wickes1/anaconda/envs/py3pbb/lib/python3.7/site-packages/ppb/__init__.py", line 34, in run
    eng.run()
  File "/Users/wickes1/anaconda/envs/py3pbb/lib/python3.7/site-packages/ppb/engine.py", line 79, in run
    self.main_loop()
  File "/Users/wickes1/anaconda/envs/py3pbb/lib/python3.7/site-packages/ppb/engine.py", line 93, in main_loop
    self.publish()
  File "/Users/wickes1/anaconda/envs/py3pbb/lib/python3.7/site-packages/ppb/engine.py", line 121, in publish
    game_object.__event__(event, self.signal)
  File "/Users/wickes1/anaconda/envs/py3pbb/lib/python3.7/site-packages/ppb/events.py", line 83, in __event__
    raise BadEventHandlerException(self, meth_name, bag) from ex
ppb.events.BadEventHandlerException: 
Player.on_update() signature incorrect, it should accept an Update object and a signal function.

Update is a dataclass that represents an event. Its attributes 
tell you about the event.

The signal function is a function you can call that accepts an event instance
as its only parameter. Call it to add an event to the queue. You don't have to
use it, but it is a mandatory argument provided by ppb.

It should look like this:

def on_update(update_event: Update, signal_function):
    (Your code goes here.)
pathunstrom commented 5 years ago

Just going to add a note that this is in regards to #266

AstraLuma commented 5 years ago

Closing this as this is commentary about a merged PR.

pathunstrom commented 5 years ago

Reopened because only part of this comments have been addressed, the rest should be broken out into their own issues before we close this one.

pradyunsg commented 5 years ago

Another item that could be useful: Using sphinx-tabs for the command line instructions.

AstraLuma commented 3 years ago

We need to finish breaking this out.

pradyunsg commented 3 years ago

FWIW, https://github.com/pradyunsg/sphinx-inline-tabs looks nice. 😅

AstraLuma commented 3 years ago

</shameless self promotion>