Created method to set position of paddle
This commit is contained in:
		@@ -25,6 +25,9 @@ public:
 | 
				
			|||||||
	/* Increments the number of points that this paddle has earned */
 | 
						/* Increments the number of points that this paddle has earned */
 | 
				
			||||||
	void incrementPoints();
 | 
						void incrementPoints();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Sets the paddle position */
 | 
				
			||||||
 | 
						void setPosition(int x, int y);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Resets the paddle position */
 | 
						/* Resets the paddle position */
 | 
				
			||||||
	void reset();
 | 
						void reset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,12 @@ void Paddle::incrementPoints() {
 | 
				
			|||||||
	return;
 | 
						return;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void Paddle::setPosition(int x, int y) {
 | 
				
			||||||
 | 
						this->rectangle.x = x;
 | 
				
			||||||
 | 
						this->rectangle.y = y;
 | 
				
			||||||
 | 
						return;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Paddle::reset() {
 | 
					void Paddle::reset() {
 | 
				
			||||||
	this->rectangle.x = this->initial_pos.x;
 | 
						this->rectangle.x = this->initial_pos.x;
 | 
				
			||||||
	this->rectangle.y = this->initial_pos.y;
 | 
						this->rectangle.y = this->initial_pos.y;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user