Skip to content

Commit b71e06c

Browse files
authored
Merge pull request jdf#202 from tabreturn/fix-oop-tutorial-indentation
Fix oop tutorial indentation
2 parents d9aec18 + c6a11d0 commit b71e06c

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎Tutorials/objects/index.html‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -515,29 +515,29 @@ <h3>Arguments to the __init__ method</h3>In the above examples,
515515
# Even though there are multiple objects, we still only need one class.
516516
# No matter how many cookies we make, only one cookie cutter is needed.
517517
class Car(object):
518-
# The Constructor is defined with arguments.
519-
def __init__(self, c, xpos, ypos, xspeed):
520-
self.c = c
521-
self.xpos = xpos
522-
self.ypos = ypos
523-
self.xspeed = xspeed
524-
525-
def display(self):
526-
stroke(0)
527-
fill(self.c)
528-
rectMode(CENTER)
529-
rect(self.xpos, self.ypos, 20, 10);
530-
531-
def drive(self):
532-
self.xpos = self.xpos + self.xspeed;
533-
if self.xpos &gt; width:
534-
self.xpos = 0
518+
# The Constructor is defined with arguments.
519+
def __init__(self, c, xpos, ypos, xspeed):
520+
self.c = c
521+
self.xpos = xpos
522+
self.ypos = ypos
523+
self.xspeed = xspeed
524+
525+
def display(self):
526+
stroke(0)
527+
fill(self.c)
528+
rectMode(CENTER)
529+
rect(self.xpos, self.ypos, 20, 10);
530+
531+
def drive(self):
532+
self.xpos = self.xpos + self.xspeed;
533+
if self.xpos > width:
534+
self.xpos = 0
535535

536536
myCar1 = Car(color(255, 0, 0), 0, 100, 2)
537537
myCar2 = Car(color(0, 255, 255), 0, 10, 1)
538538

539539
def setup():
540-
size(200,200)
540+
size(200,200)
541541

542542
def draw():
543543
background(255)

0 commit comments

Comments
 (0)