Skip to content

Commit

Permalink
Merge #494
Browse files Browse the repository at this point in the history
494: Fixing indentation in quickstart docs r=pathunstrom a=alysivji

Excited to make my first game with ppb.

Co-authored-by: Aly Sivji <alysivji@gmail.com>
  • Loading branch information
bors[bot] and alysivji authored Jun 20, 2020
2 parents f34fed3 + 14c5588 commit fbf738b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Halle Jones|HJones@aliacy.com||
[Sanket Dasgupta](https://github.com/SanketDG) | [sanketdasgupta@gmail.com](sanketdasgupta@gmail.com) | [@SanketDG](https://twitter.com/SanketDG)
[Serin Delaunay](https://github.com/serin-delaunay) | | [SerinDelaunay](https://twitter.com/SerinDelaunay)
[Nils Müller](https://github.com/shimst3r) | [shimst3r@gmail.com](mailto:shimst3r@gmail.com) | [@shimst3r](https://twitter.com/shimst3r)
[Aly Sivji](https://github.com/alysivji) | | [@CaiusSivjus](https://twitter.com/CaiusSivjus)
20 changes: 10 additions & 10 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,16 @@ First, we need a new class. We'll put it under ``Player``, but above ``setup``.
``main.py``::

class Projectile(ppb.Sprite):
size = 0.25
direction = ppb.Vector(0, 1)
speed = 6

def on_update(self, update_event, signal):
if self.direction:
direction = self.direction.normalize()
else:
direction = self.direction
self.position += direction * self.speed * update_event.time_delta
size = 0.25
direction = ppb.Vector(0, 1)
speed = 6

def on_update(self, update_event, signal):
if self.direction:
direction = self.direction.normalize()
else:
direction = self.direction
self.position += direction * self.speed * update_event.time_delta

If we wanted to, we could pull out this ``on_update`` function into a mixin that
we could use with either of these classes, but I'm going to leave that as an
Expand Down

0 comments on commit fbf738b

Please sign in to comment.