# PolygonCeption - Need Help

**URL:** <https://discourse.codecombat.com/t/polygonception-need-help/14284>\
**Category:** Uncategorized\
**Created:** [March 27, 2018, 3:55pm UTC](https://discourse.codecombat.com/t/polygonception-need-help/14284 "2018-03-27T15:55:02Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Neel\_Sharma](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@Neel\_Sharma](https://discourse.codecombat.com/u/Neel_Sharma)\
**Post date:** [April 2, 2018, 10:43pm UTC](https://discourse.codecombat.com/t/polygonception-need-help/14284/10 "2018-04-02T22:43:12Z")

</div>

I saw something like that in a different polygonception forum which had been dead for years. [Here](https://discourse.codecombat.com/t/cannon-read-property-read-of-undefined-in-polygonception/5451/2) is the threads link.

Edit: I have some new code to show. I think this will work except for the original error. Here it is

```python
# You are on your own this time, I hope you have learned what you need from the previous fractal levels. Check the guide for help with what you need to do and with the math required for polygons.

# You need a function to convert degrees to radians. Multiply degrees by Math.PI / 180.
def degreesToRadians(degrees):
    degrees * Math.PI / 180
# Your polygon function should have 3 inputs: start, end, and sides.
def polygonMaker(start, end, sides):
    # Remember to make your polygon recursive, drawing extra polygons at every corner.
    heroShouldStartHere = Vector.subtract(yak.pos, hero.pos)
    full = Vector(start, end)
    for side in sides:
        i = 0
        while i < len(sides):
            nextMovement = Vector.add(start, side)
            i += 1
        i = 0
        break
    
# To get the start and end position for each polygon, add startOffset and endOffset to the yak's position.
startOffset = Vector(-15, -15)
endOffset = Vector(15, -15)
yaks = hero.findByType("ice-yak")
for yak in yaks:
    start = Vector.add(yak.pos, startOffset)
    end = Vector.add(yak.pos, endOffset)
    sides = yak.sides # You need to loop through all the yaks, drawing a polygon for each. Yaks are enemies.
    polygonMaker(start, end, sides)

```

---

_[View the full topic](https://discourse.codecombat.com/t/polygonception-need-help/14284)._
