Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2P操作的时候,1P也会跟着动 #2

Open
732275239 opened this issue Jul 13, 2023 · 11 comments
Open

2P操作的时候,1P也会跟着动 #2

732275239 opened this issue Jul 13, 2023 · 11 comments

Comments

@732275239
Copy link

No description provided.

@Beseting
Copy link
Owner

操作Player按键的时候区分PLAYER1 or PLAYER2
EmulatorManager.getInstance().pressKey(${player}, key)

@732275239
Copy link
Author

我是打算开发一个TV端的小游戏软件,现在遇到的问题就是,我为了适配手柄,已经可以在onKeyDown和onKeyUp里面区分玩家1和玩家2,然而,手柄的方向键,能够被BaseEmulatorActivity捕捉,导致现在2P操作方向,1P也会跟着动
例如 : EmulatorManager.getInstance().pressKey(EmulatorManager.Player.PLAYER2, EmulatorManager.ControllerKey.LEFT);
玩家1 和 玩家2 都会跟着一起左移

@732275239
Copy link
Author

732275239 commented Jul 13, 2023

补充,我把所有的方向控制全部去掉了,但是主手柄还是能控制1P的上下左右,而2P则不能动,可不可以在源码里面,把方向键的控制全部去掉,只允许开发者自己去用代码调用?

@Beseting
Copy link
Owner

git的源码check下来 demo能跑吗 1p 2p的方向控制是否都OK呢?

@732275239
Copy link
Author

触摸控制是开发者自定义,没问题,但手柄的方向键和摇杆是被系统接管了,我得想想办法去拦截

@732275239
Copy link
Author

NesEmulator的源码目前是混淆没开放么?

@Beseting
Copy link
Owner

拦截外设指令,然后根据指令类型调用对应控制API即可,应该是没有问题的 你可以打断点看看 是不是业务上有什么问题或者异常调用了

@Beseting
Copy link
Owner

虚拟键盘多点触控 两个player均控制分离 没有问题 那外设控制只是指令转换流程了

@732275239
Copy link
Author

嗯 我只能尝试拦截自行处理,但是手柄的指令没法改,网上买的那种手柄

@Kuki93
Copy link

Kuki93 commented Sep 14, 2024

混淆有问题,进入游戏设置会闪退,nof found class,混淆问题

@Beseting
Copy link
Owner

混淆有问题,进入游戏设置会闪退,nof found class,混淆问题

#5 (comment) 设置是通过EmulatorManager.getInstance().set(EmulatorManager.Settings.XXX,value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants