java - Moving object when is touched -
i use code move object:
if (gdx.input.istouched()) { gameobject1.y=gdx.graphics.getheight()-gdx.input.gety() + 30; gameobject1.x=gdx.input.getx() + 30; }
but in case, object move when screen touched. in libgdx simple way move object when object clickedd/pressed? code above?
the simple way use scene2d
this. has hit detection feature, based on event system can use attaching listeners actors
.
another way use intersector
in combination rectangle
bounding box , hit detection yourself.
Comments
Post a Comment