Noops Week One: Vexing Vectors discussion

This is a space to share and discuss with your fellow challengers. Feel free to post comments below and start the conversation. Good luck challengers!

1 Like

Hey I’m pretty noob with js, and I’m working with the canvas part of the vexbot code. I am trying to limit the vectors to only appear within the rectangle that is the bg (which I’ve already limited), but I’m not sure how to do this. Obviously I can’t change the api vectors coming in to fit within the bounds of the bg, but once they have arrived is there a way I can draw the vector but then cut off the parts that escape the bg? Currently it comes out like this: