# New to code, need help please!

**URL:** https://discourse.processing.org/t/new-to-code-need-help-please/19202
**Category:** Beginners
**Created:** [March 30, 2020, 6:44pm UTC](https://discourse.processing.org/t/new-to-code-need-help-please/19202 "2020-03-30T18:44:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cakiru](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cakiru](https://discourse.processing.org/u/cakiru)
#### Post date: [March 30, 2020, 6:44pm UTC](https://discourse.processing.org/t/new-to-code-need-help-please/19202/1 "2020-03-30T18:44:55Z")

</div>

if you could help me , im trying to make a loop rotate by clicking

 ![1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8f2f0b033dfee4178fae6c371e470393245473c6.png)

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [March 30, 2020, 7:29pm UTC](https://discourse.processing.org/t/new-to-code-need-help-please/19202/2 "2020-03-30T19:29:23Z")

</div>

Pictures of code aren’t helpful.

Please post the code itself.

Remember to format it with the magic code formatting button, which looks like this: \</\>

---

<div class="post-metadata">

### Author: ![cakiru](https://avatars.discourse-cdn.com/v4/letter/c/5fc32e/32.png) [@cakiru](https://discourse.processing.org/u/cakiru)
#### Post date: [March 30, 2020, 7:45pm UTC](https://discourse.processing.org/t/new-to-code-need-help-please/19202/4 "2020-03-30T19:45:19Z")

</div>

```auto
void setup() {// corre somente uma vez e prepara
  size(1000, 1000);
  background(255);
  locX = width/2;
  locY = height/2;
}

//desenhar
void draw() {//corre quantas vezes quisermos/ desenha ciclos/ desenhar graficos em movimento

  background(255);

  //posição
  //rotação
  //escala
  //sem pushmatrix, escala e atua em tudo
  // criar um cliclo de 10 robots

  for (int i = 0; i < 10; i ++) {
   
      pushMatrix();//guarda
      translate(mouseX, mouseY);// define localização do ponto inicial do objeto// posição do r
      rotate(radians(i *36));// roda o objeto a partir de um ponto e multiplica
      robot(691, 0, 0.5);
      popMatrix();
       if (mousePressed) {// ao clicar faz os seguinte:
       rotate(r);

         r = 546;
    }
  }
}  

//inserir robot pessoal
void robot(int x, int y, float s ) {//cria função legoHead/ inserir parametros

  scale(s);
  //--------------------------------------------------------------------------------inicio do desenho
  //pescoço
  stroke(0);
  fill(#E04D30);//Cor de pescoço
  rect(x-15, Y-135, 30, 30);
  rect(x-15, Y-105, 30, 20);
  rect(x-15, Y-95, 30, 20);
  //sombra
  fill(149, 48, 30);
  rect(x+5, Y-135, 10, 30);
  rect(x+5, Y-105, 10, 20);
  rect(x+5, Y-95, 10, 20);

```

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [April 5, 2020, 7:37pm UTC](https://discourse.processing.org/t/new-to-code-need-help-please/19202/5 "2020-04-05T19:37:37Z")

</div>

It seems like the top and the bottom of the code you pasted is missing, so it cannot be run.

> locX cannot be resolved to a variable

…and part of robot is missing – maybe just a }, or maybe more.
