Here are my enemy movement function. I want that my enemy in random Y-position throw a bunch of things in to the player. And I want to implement physics using Box2D. But I know that Box2D workd only in meters. So how for example my enemy coud throw a ball(BOX2D object (METERS)) into the player from it’s positiion(PIXELS)?
public void update(float dt){
dtTime += dt;
if(cont && goTo){
setBooleans();
vec.set(saveX - x, saveY - y).nor();
x += vec.x * speed;
y += vec.y * speed;
if(!onWall){
cont = cont();
}
}
}
