Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Pilka.h"
- #include <iostream>
- using namespace std;
- Ball::Ball(double x, double y,double xSpeed,double ySpeed)
- {
- this->x = x;
- this->y = y;
- this->xSpeed = xSpeed;
- this->ySpeed = ySpeed;
- }
- double Ball::getX() const {
- return x;
- }
- double Ball::getY() const {
- return y;
- }
- void Ball::setX(double a) {
- x = a;
- }
- void Ball::setY(double b) {
- y = b;
- }
- double Ball::getXSpeed() const {
- return xSpeed;
- }
- void Ball::setXSpeed(double aSpeed) {
- xSpeed = aSpeed;
- }
- double Ball::getYSpeed() const {
- return ySpeed;
- }
- void Ball::setYSpeed(double bSpeed) {
- ySpeed = bSpeed;
- }
- void Ball::setXY(double a, double b) {
- x = a;
- y = b;
- }
- void Ball::setXYSpeed(double aSpeed, double bSpeed) {
- xSpeed = aSpeed;
- ySpeed = bSpeed;
- }
- void Ball::move() {
- this -> x = x + xSpeed;
- this -> y = y + ySpeed;
- }
- void Ball::print() const {
- cout << "Ball @ (" << x << "," << y << ") z predkoscia (" << xSpeed << "," << ySpeed << ")" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement