emufreak / iAmiga

iAmiga sources
47 stars 17 forks source link

Added motion controller as an alternative to virtual touch dpad. #43

Closed MrStargazer closed 8 years ago

MrStargazer commented 8 years ago

The motion controller lets you control the joystick directions (vdpad) by moving the device around the x- and y axis. All 8 directions from the amiga joystick are supported. As until now the one and four buttons will be used from the virtual joystick.

The new controller can be turned on under the settings for virtual dpad, called DPadMode. If DPadMode "Motion" is selected, you can configure and calibrate the controller.

I think this is a first version and there is more to do, but I don't want to wait any longer.

mithrendal commented 8 years ago

Wow this is really well done. The perfect controller for the game "desert strike".

simontoens commented 8 years ago

Rock'n'Roll could be fun with this also: http://www.lemonamiga.com/games/details.php?id=911

emufreak commented 8 years ago

@MrStargazer Marble Madness might be fun too. Really like what you've done here. You should not access Joypadmethods directly though and Instead call the methods in Multipeerconnectivity.

This way it works when using the iphone as a controller and keymapping can be used.

MrStargazer commented 8 years ago

@emufreak I will try to fix that soon.

MrStargazer commented 8 years ago

@emufreak Why has the input controller and any other game controller who uses the mpc to know, which mode, client or server, is used? I think, if alle joystick controller implementations using the MPC as the main interface to the emulator then the mpc-controller should also decide/know which server/client mode is used. What do you think?

emufreak commented 8 years ago

@MrStargazer Yes you're right it makes more sense to handle this in the MPCController class. So the Gamecontroller just needs to call MPCController and MPCController sends to the remote MPCController if necessary. I'll change this in my next commit. I think it's easier if i make the necessary changes on your controller too in this case. It should only be a linee of code or two in this case anyway.

mithrendal commented 8 years ago

👍 good decision. Excellent. Just a minor thing. I saw that nearly all interface methods of the mpccontroller are beginning with the prefix "send". Could you distinguish the methods which do handle the joystick state by another prefix? Maybe executeInputButtons and executeInputDirection. Or handleInputButton and handleInputdirection. Or processInputDirection/Button. But leaving the names of methods sendJoystickDataForDirection/buttonId as they are. That way it becomes more clear which methods actually send data over the mpc connection and which methods do handle and process the joystick signals. What do you think?

emufreak commented 8 years ago

@mithrendal I think this makes sense. I'll change the name of the methods.