-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtriangleClass.py
More file actions
32 lines (26 loc) · 830 Bytes
/
triangleClass.py
File metadata and controls
32 lines (26 loc) · 830 Bytes
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
import pyglet
import math
class triangleClass:
def __init__(self, ID, color, xcenter, ycenter, rad):
""" initialize a triangle """
self.ID = ID
self.color = color
self.x = xcenter
self.y = ycenter
self.radius = rad
def setCentreCoordinates(self, xcenter, ycenter):
""" set the x,y coordinates of the triangle """
self.x = xcenter
self.y = ycenter
def getColor(self):
""" return the color of the triangle """
return self.color
def getRadius(self):
""" return the radius of the triangle """
return self.radius
def getX(self):
""" return the x coordinate of the triangle """
return self.x
def getY(self):
""" return the y coordinate of the triangle """
return self.y