Skip to content

Commit a000f69

Browse files
committed
fixed drawing methods to virtual
1 parent 71964d6 commit a000f69

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

chapters/OOPs!/examples/oops_6/src/Ball.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Ball {
1717
// methods, equivalent to specific functions of your class objects
1818
void setup(float _x, float _y, int _dim); // setup method, used to define the initial state of the object: runs only once!
1919
void update(); // update method, used to refresh your objects properties: runs constantly
20-
virtual void draw(); // we made this now a virtual because we'll redefine it in derived classes
20+
void draw(); // draw method
2121
// variables
2222
float x; // position
2323
float y;

chapters/OOPs!/examples/oops_6/src/BallBlue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class BallBlue : public Ball { // we set the class to inherit from 'ofBall'
77

88
public:
99

10-
void draw(); // this is the only methid we actually want to be different from the 'mother class'
10+
virtual void draw(); // this is the only method we actually want to be different from the 'mother class'
1111

1212
};

chapters/OOPs!/examples/oops_6/src/BallGreen.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class BallGreen : public Ball { // we set the class to inherit from 'ofBall'
77

88
public:
99

10-
void draw(); // this is the only methid we actually want to be different from the 'mother class'
10+
virtual void draw(); // this is the only method we actually want to be different from the 'mother class'
1111

1212
};

chapters/OOPs!/examples/oops_6/src/BallRed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class BallRed : public Ball { // we set the class to inherit from 'ofBall'
77

88
public:
99

10-
void draw(); // this is the only methid we actually want to be different from the 'mother class'
10+
virtual void draw(); // this is the only method we actually want to be different from the 'mother class'
1111

1212
};

0 commit comments

Comments
 (0)