-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPVector.cpp
More file actions
89 lines (73 loc) · 1.3 KB
/
Copy pathPVector.cpp
File metadata and controls
89 lines (73 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "PVector.h"
//Default constructor
PVector::PVector()
{
x = 0;
y = 0;
}
//constructor for private data members
PVector::PVector(float x_, float y_, float xSpeed_, float ySpeed_)
{
x = x_;
y = y_;
xSpeed = xSpeed_;
ySpeed = ySpeed_;
}
/* //constructor for private data members
PVector(float xSpeed_, float ySpeed_)
{
xSpeed = xSpeed_;
ySpeed = ySpeed_;
} */
//implement getters for private data members
float PVector::GetX()
{
return x;
}
float PVector::GetY()
{
return y;
}
float PVector::GetXSpeed()
{
return xSpeed;
}
float PVector::GetYSpeed()
{
return ySpeed;
}
//implement setters for private data members
void PVector::SetX(const float x_)
{
x = x_;
}
void PVector::SetY(const float y_)
{
y = y_;
}
void PVector::SetXSpeed(const float xSpeed_)
{
xSpeed = xSpeed_;
}
void PVector::SetYSpeed(const float ySpeed_)
{
ySpeed = ySpeed_;
}
//Function to set position of ball
void setXY()
{
}
//Function to set speed of ball
void setXYSpeed()
{
}
//Function to increase location based on speed respectively
void move()
{
/*x = x + xSpeed;
y = y + ySpeed;*/
}
//Function to display ball location and speed
void print()
{
}