As a fellow programmer, I definitely understand the temptation to be clever (because who doesn’t like one-liners?) but let me be clear - cleverness often comes at the cost of lowered readability. In the future, if you have a question like this again where you post code, it will be to your benefit to have readable code - the faster I can understand what’s going on, the sooner I can give you feedback. In this specific case, it wasn’t problematic, but as code grows, so does the time it takes to read it. In addition, time spent trying to be clever, and condense 5 lines into 1 is time better spent working towards the actual problem (I’m totally guilty of this sometimes, but hey)
With that being said, here are a couple of the potential hiccups I saw
- Your use of translate() within move()
- The rotate(40)
The function translate() is cumulative. As the docs put it:
Transformations are cumulative and apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling translate(50, 0) and then translate(20, 0) is the same as translate(70, 0). If translate() is called within draw(), the transformation is reset when the loop begins again. This function can be further controlled by using push() and pop().
The function rotate() is cumulative as well. However, it uses RADIANS (unless specified with angleMode().
If I had to give you a first step, it would be to do a little more research on the theory behind matrix transformations. But don’t get discouraged! The grind is worth it
Don’t check this sketch until you’ve done your homework!