Moved to main directory instead of src folder
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package control;
|
||||
|
||||
import model.GameModel;
|
||||
import view.GameView;
|
||||
import control.button.ButtonEvent;
|
||||
import control.button.ButtonListener;
|
||||
import control.joystick.JoystickEvent;
|
||||
import control.joystick.JoystickListener;
|
||||
|
||||
public class GameControl implements JoystickListener, ButtonListener{
|
||||
|
||||
GameModel model;
|
||||
GameView view;
|
||||
|
||||
public GameControl(GameModel model, GameView view)
|
||||
{
|
||||
this.model = model;
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonPressed(ButtonEvent e) {
|
||||
if(e.getButton().getButtonID()>0)
|
||||
{
|
||||
view.setColor(e.getButton().getColor());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonReleased(ButtonEvent e) {}
|
||||
|
||||
@Override
|
||||
public void onJoystickMoved(JoystickEvent e) {
|
||||
view.setString(e.getJoystick().getPos().name());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user