# I want to make stickmans move

**URL:** <https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [February 28, 2020, 5:11am UTC](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204 "2020-02-28T05:11:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [February 28, 2020, 8:38am UTC](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204/3 "2020-02-28T08:38:57Z")

</div>

That’s right.

It’s very hard to do programmatically, especially the coordination of the angles

see also [Push matrix and trig functions help (robot BD-1)](https://discourse.processing.org/t/push-matrix-and-trig-functions-help-robot-bd-1/16795)

example below with one leg

```auto
float x; 

float a=2.29;
float aAdd=.04; 

float b=0.3;
float bAdd=.04; 

void setup()
{
  // init
  size(1800, 600);
} // func 

void draw() 
{
  // runs on and on 
  background(0);

  stroke(255); 

  translate(width+x, height/2); 
  x--;
  ellipse(-6, -66, 22, 22); 
  line ( 0, -44, 
    0, 44);

  // upper thigh
  translate(0, 44);
  rotate(a);
  line(0, 0, 44, 0);

  // lower thigh
  translate(44, 0);
  rotate(b);
  line(0, 0, 44, 0);

  a+=aAdd;
  if (a>2.5)
    aAdd=-1*abs(aAdd);
  if (a<.6)
    aAdd=abs(aAdd);

  b+=bAdd;
  if (b>0.0)
    bAdd=-1*abs(bAdd);
  if (b<-1)
    bAdd*=-1;
} // func 

// --------------------------------------------------

```

---

_[View the full topic](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204)._
