Tag Info

New answers tagged

0

3.5mm support would probably be easier if you want something to work out of the box by default. Android is a very mature platform at this point and it has plenty of other applications besides just a Phone operating system. The OS has a fairly well documented USB api: https://developer.android.com/guide/topics/connectivity/usb/index.html which can probably ...


2

Based on my memories and for example this: While it's difficult to understand the complicated ANDs and ORs, it seems clear that you forgot to check for the jumpButton being pressed after the other buttons. With leftButton and rightButton, you have Gdx.input.isTouched(0) as well as Gdx.input.isTouched(1) (with OR inbetween them, so I take that as you're ...


1

I 'll try to manage InputController changing its behaviour at runtime (in c# can use some kind of delegates) Examples : if activated in_game state then InputController.processInput = logic1 if activated menu state then InputController.processInput = logic2 if activated inventory state then InputController.processInput = logic3 Logic1..N are alternative ...


1

In instances like this I use a stack of input maps. You already have certain buttons doing this or that while playing the game, if you can group that logic into a map (array of button/key => some event) then you can make multiple maps for the different states you have. From there you just need 'some event's that can be used to push and pop the maps from a ...


1

You aren't over complicating it at all. This is a great way to think about a game. It keeps the game flexible for any changes you want to add in the future (say a stats screen). The first place I would look is using the Strategy Pattern: Wikipedia Determine what input triggers you would need and add them to an abstract interface. Then, implement the ...


1

Are you assigning cheetahX to something or drawing with it? You did not post your drawing method or where you use cheetahX further on in your code. I predict that Cheetah holds your InputHandler then you need this: public class inputHandler implements InputProcessor { private cheetah cheetah; private gameWorld myWorld; private float cheetahX; ...


1

Store the keys from the last frame and compare in the current frame. if(!old_keys[key] && keys[key]) { /* pressed since last frame */ } if(old_keys[key] && !keys[key]) { /* released since last frame */ } if(old_keys[key] && keys[key]) { /* held since last frame */ }


0

After some time and research, I got to know that you actually lose only one physics step, and not a whole game frame. And if you're updating your physics at a high rate (you should update it at least two times faster than the expected frame rate!), then it will probably go unnoticeable. In my game I'm using a 0.008s (125fps) physics step and can't barely ...


1

Below code works for me, I get the message when pressing the back button. if (Gdx.input.isKeyJustPressed(Input.Keys.BACK)) { Gdx.app.log("Debug", "Back pressed!"); } Are you calling below method before the one above? Gdx.input.setCatchBackKey(true);


0

Converting comment to answer: Yeah it totally will. You can try and hide it through predictive animations and other things, but that's all smoke and mirrors. It will affect responsiveness definitely. How bad it is depends on your frame rate of course. It also depends on the needs of your game. A twitch game like quake would show the problem very clearly ...


2

I have not looked in your sample but you want to create panel within your canvas. I name mine ScrollView and attached is the Scroll Rect and mask. set the scroll rect to verticle, elasticity to .1 and sensitivity to around 25. It is important that the Content of scrollview is filled with the container panel that will be a child of the View panel. Also is ...


0

Below I've posted something I mocked up going for deformable pixel terrain. You may be able to get something from it... You may not... Either way, It can obtain the pixels of an image around the mouse position. The names are pretty self explanatory but if you don't understand something, post a comment here. using UnityEngine; using System.Collections; using ...



Top 50 recent answers are included