Skip to content

Commit

Permalink
Add ellipse functions #2
Browse files Browse the repository at this point in the history
  • Loading branch information
hallucino committed Mar 5, 2017
1 parent d692e7e commit 2b6c9e5
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 100 deletions.
22 changes: 20 additions & 2 deletions demos/api_demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,23 @@ def draw(self):
cls()
trigon(random_coord(), random_coord(), random_coord(), random_coord(), random_coord(), random_coord(), random_color())

class Ellipse(object):
def __init__(self):
self.T = 0

def init(self):
cls()

def update(self):
self.T += 1

def draw(self):
if self.T % 20 == 1:
cls()
ellipse(random_coord(), random_coord(), random_radius(), random_radius(), random_color())
ellipsefill(random_coord(), random_coord(), random_radius(), random_radius(), random_color())


class Line(object):
def __init__(self):
self.T = 0
Expand Down Expand Up @@ -166,8 +183,8 @@ def __init__(self):
self.T = 0

def init(self):
set_color(16, 255, 51, 255)
set_color(17, 128, 255, 0)
set_palette_color(16, 255, 51, 255)
set_palette_color(17, 128, 255, 0)

def update(self):
self.T += 1
Expand Down Expand Up @@ -206,6 +223,7 @@ def draw(self):
["rect", [Rect()]],
["circ", [Circ()]],
["trigon", [Trigon()]],
["ellipse", [Ellipse()]],
["line", [Line()]],
["spr", [Spr()]],
["sspr", [SSpr()]],
Expand Down
Loading

0 comments on commit 2b6c9e5

Please sign in to comment.