Skip to content

Commit

Permalink
Update docstrings and .flake8 ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
arnauddupuis committed Aug 30, 2020
1 parent e193eff commit 6f94789
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[flake8]
max-line-length = 88
ignore = W605, W503
12 changes: 7 additions & 5 deletions pygamelib/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,8 @@ def run(self):
3. Accumulates the elapsed time in the player dtmove variable (if there is a
player object configured)
4. It sets the cursor position to 0,0 (meaning that your user_update function
will draw on top of the previously drawn window). The Board.display() and
Board.display_around() method clean the end of their line.
will draw on top of the previously drawn window). The Board.display() and
Board.display_around() method clean the end of their line.
5. It calls the user_update function with 3 parameters: the game object, the
key hit by the user (it can be None) and the elapsed time between to calls.
6. Clears the end of the screen.
Expand Down Expand Up @@ -2129,7 +2129,8 @@ def actuate_projectiles(self, level_number, elapsed_time=0.0):

def animate_items(self, level_number, elapsed_time=0.0):
"""That method goes through all the BoardItems of a given map and call
Animation.next_frame()
Animation.next_frame().
:param level_number: The number of the level to animate items in.
:type level_number: int
:param elapsed_time: The amount of time that passed since last call. This
Expand All @@ -2142,6 +2143,7 @@ def animate_items(self, level_number, elapsed_time=0.0):
Example::
mygame.animate_items(1)
"""
if self.state == constants.RUNNING:
if type(level_number) is int:
Expand Down Expand Up @@ -3014,9 +3016,9 @@ def display_line(self, *text, end="\n", file=sys.stdout, flush=False):
So if you want to benefit from the increase performances you should use
display_line().
:param *text: objects that can serialize to str. The ANSI sequence to clear the
:param \*text: objects that can serialize to str. The ANSI sequence to clear the
end of the line is *always* appended to the the text.
:type *text: str|objects
:type \*text: str|objects
:param end: end sub string added to the printed text. Usually a carriage return.
:type end: str
:param file:
Expand Down
7 changes: 4 additions & 3 deletions pygamelib/gfx/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,9 +953,10 @@ class SpriteCollection(UserDict):
Its main goal is to provide an easy to use object to load and save sprite files.
On top of traditional dict method, it provides the following capabilities:
- loading and writing from and to JSON files,
- data serialization,
- shortcut to add sprites to the dictionnary.
- loading and writing from and to JSON files,
- data serialization,
- shortcut to add sprites to the dictionnary.
A SpriteCollection is an unordered indexed list of Sprites (i.e a dictionnary).
Expand Down

0 comments on commit 6f94789

Please sign in to comment.