Skip to content

Commit c6a11d0

Browse files
committed
Change to two-space indent
1 parent 3af9894 commit c6a11d0

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

‎Tutorials/objects/index.html‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -515,36 +515,36 @@ <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 > 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():
543-
background(255)
544-
myCar1.drive()
545-
myCar1.display()
546-
myCar2.drive()
547-
myCar2.display()
543+
background(255)
544+
myCar1.drive()
545+
myCar1.display()
546+
myCar2.drive()
547+
myCar2.display()
548548

549549
</pre>
550550

0 commit comments

Comments
 (0)