Help with object actions

Hello everybody…

I'm doing a very simple laboratory (that extends SimpleGame), that will be have very simple actions, like open a door, grab a bottle, open an window, but for this i will need some input actions, right? but, how I make an action for just the door, that when I click the door, it opens, or, another action for window, that when I click the window, the window opens. What i will have to do??? make another class that is responsible for each click?? How I do this?.. Is there a way to make for each object have it own MouseInputHandler??? (like, for example, sphere.addAction???)

Is it like doing java swing handler??? adding for each object on the screen a new ActionHandler???

Please, help me…  :expressionless:

Thanks…  :wink:


have a look at TestPick it may answer some of your questions.

Hi Guilherme!!!

try something like this:

if (MouseInput.get().isButtonDown(0) == true) {

thanks for both help…  :smiley:

but, hunter, where I put this code, on a new class??? on initGame, updateGame???

for instance:

public class MouseManager extends MouseInputAction{