Jump to content

  • Log In with Google      Sign In   
  • Create Account

Pedrog

Member Since 12 May 2013
Offline Last Active May 22 2013 02:53 PM

Posts I've Made

In Topic: Simple Movement With Processing+Box2d

17 May 2013 - 04:43 PM

Hi Pedrog, 

I found it difficult to understand some of your code, just because of the language, and i only had a minute to look over it but i think the problem may be here ? 

void draw() {
  background(255); //colocamos um plano de fundo na cor branca
  box2d.step(); // a cada vez que draw fizer 1 loop,
  //sera feito um loop nas acoes da box2d
  Personagem personagem = new Personagem(20,20);
  personagem.display();
}

 

If this method is being called every frame, then personagem is being created at every frame, and is being passed x: 20 and y: 20 position. Thats if i read it right ;)

 
Thank you smile.png I've got it right yesterday today. The line "Personagem personagem = new Personagem(20,20);" musted be only called in setup, as all the other "class constructors", I'm having other problems that I need help, but to avoid the mess I'll create other topic.

Thanks again smile.png


PARTNERS