box2d + scene2d the actor does not behave naturally

Anything libgdx related goes here!

Re: box2d + scene2d the actor does not behave naturally

Postby shatterblast » Tue Sep 03, 2019 7:19 pm

Then try your device input on Ball to see what happens. I think it relates to your InputListener or how the data coming through gets handled, since Ball works fine apart from your device's input. Guessing that act() works mostly fine for your Player class and that act() in Ball works how it should, I would naturally suggest InputListener as the next place to examine.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: box2d + scene2d the actor does not behave naturally

Postby TruePlayer » Tue Sep 03, 2019 8:20 pm

the ball also flies down if me its position through the listener
TruePlayer
 
Posts: 103
Joined: Sun Jul 28, 2019 12:22 pm

Re: box2d + scene2d the actor does not behave naturally

Postby shatterblast » Tue Sep 03, 2019 8:33 pm

Then the act() methods of Ball and Player are probably fine in regards to your device input. If touchUp() in your InputListener seems to have no effect right now, then I would leave it temporarily removed.

For a temporary time, you might try separately removing ...
Code: Select all
player.setPosition(x, y);

... one at time in your touchUp() and touchDragged() methods. The idea involves seeing which method is the source of trouble.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: box2d + scene2d the actor does not behave naturally

Postby TruePlayer » Tue Sep 03, 2019 8:38 pm

will try
TruePlayer
 
Posts: 103
Joined: Sun Jul 28, 2019 12:22 pm

Re: box2d + scene2d the actor does not behave naturally

Postby TruePlayer » Tue Sep 03, 2019 8:47 pm

no result! I think the listener works correctly, because when I touch with my finger I get both the body and the actor and the sprite at the right point, as soon as I let the pole go, everything goes down.
TruePlayer
 
Posts: 103
Joined: Sun Jul 28, 2019 12:22 pm

Re: box2d + scene2d the actor does not behave naturally

Postby shatterblast » Tue Sep 03, 2019 9:19 pm

Well, it still relates to your device input, since both Ball and Player seemingly behave the wrong way when receiving input. I'm not sure what else to tell you.
shatterblast
 
Posts: 414
Joined: Sun Jul 06, 2014 1:14 pm

Re: box2d + scene2d the actor does not behave naturally

Postby TruePlayer » Tue Sep 03, 2019 10:58 pm

abnormal behavior appears before input.
the player initially goes away, and as soon as I make an input, he appears.
TruePlayer
 
Posts: 103
Joined: Sun Jul 28, 2019 12:22 pm

Re: box2d + scene2d the actor does not behave naturally

Postby TruePlayer » Wed Sep 04, 2019 8:30 pm

Mayday
TruePlayer
 
Posts: 103
Joined: Sun Jul 28, 2019 12:22 pm

Previous

Return to Libgdx

Who is online

Users browsing this forum: Google [Bot] and 1 guest