I am making a fishing game where you fish up plastic from the water, can anyone help, i want the hook to pick up the plastic when they touch. I have no clue what I'm doing.
//global Hook hook = new Hook(); //Act method if(isTouching(Hook.class)) setLocation(hook.getX(), hook.getY());
//global Hook hook = new Hook(); //Act method if(isTouching(Hook.class)) setLocation(hook.getX(), hook.getY());
hook hook = new hook();
//Act method
if(isTouching(hook.class))Actor Bottle = getOneIntersectingObject(hook.class);
Actor bottle = getOneIntersectingObject(Bottle.class);
if (bottle != null)
{
// (code)
}if (isTouching(Bottle.class))
{
removeTouching(Bottle.class);
((MyWorld)getWorld()).getCounter().bumpCounter(1);
}if (isTouching(Bottle.class))
{
removeTouching(Bottle.class);
((MyWorld)getWorld()).getCounter().bumpCounter(1);
}