# 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:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![seojin051005](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@seojin051005](https://discourse.processing.org/u/seojin051005)
#### Post date: [February 28, 2020, 5:11am UTC](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204/1 "2020-02-28T05:11:54Z")

</div>

Hello, I’m currently learning how to use processing in the school for an upcoming big project- making an advertisement for sports day. For my advert, I want to make my stickman running by animating the stickmans, but I don’t know how to. Can someone please tell/help me how to animate stickmans to make them run?

---

<div class="post-metadata">

### Author: ![ctrembla](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@ctrembla](https://discourse.processing.org/u/ctrembla)
#### Post date: [February 28, 2020, 6:04am UTC](https://discourse.processing.org/t/i-want-to-make-stickmans-move/18204/2 "2020-02-28T06:04:50Z")

</div>

first you need to have someone or you draw the stickman then flip through the pictures

---

<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 

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

```
