New answers tagged

0

Welp, seems a bunch of RegEx works... if (Pattern.matches("[A-Za-z0-9\\s_\\+\\-\\.,!@#\\$%\\^&\\*\\(\\);\\\\/\\|<>\"'\\[\\]\\?=]", String.valueOf(Keyboard.getEventCharacter()))) { value += Keyboard.getEventCharacter(); }


0

Add this where you add the code to the string: value += String.valueOf(Keyboard.getEventCharacter()); value = value .replaceAll("[^\\w\\s\\]","");


0

You need to check for Character.isLetterOrDigit(char), and if it returns false, skip it.


1

I have found one system that could work well. I'd like to contribute some of it to Nicol Bolas which made me think of this while reading his answer. The main difference here from what I've been thinking earlier is the realization that every input-slot doesn't need to be filled in. This "negative input space" as I like to call it adds to the number of ...


0

You're going in the wrong direction in my opinion. You want to have locks, wich can't be bruteforced. Making it like that makes the people angry and makes the feel of the game go away. Ypu should make locks, wich no one wants to bruteforce. If someone sees a lock with 7 levers, and 7 symbols in each of them, he either rage quits or checks the answer on the ...


1

Generally speaking, you don't. What you're talking about is a general kind of puzzle that I would describe as a "combination lock". There's some interface for the user to enter a combination, but the number of entries is too vast to brute-force for the user. So instead, the user actually solves the clues needed to solve the puzzle. Myst and its ilk thrive ...


0

It would be great if your question was more specific, like dragging a game object or something. However you can use Interface to solve the problem. The demo code is given here. If you have questions regarding how to use it feel free to ask. using UnityEngine; using UnityEngine.EventSystems; public class AnswersManager : ...


6

Check if Touch TouchPhase is Stationary, which even says will be set only if: A finger is touching the screen but hasn't moved. I suggest you also read up on the Touch.phase property, which exposes the TouchPhase for the specific Touch. The link also has examples on how to use the phase. The other option is to check the deltaPosition of the Touch. If ...


0

You can use also container reference, getInput and check if a key is pressed, down, etc.. For example: container.getInput().isKeyPressed(Input.KEY_SPACE) see more details on javadoc


4

Presumably you have the center point of the ring (c), and the radius of the inner and outer segments of the valid portion of the ring (ri and ro, respectively) Then, given any touch point p, you simply need to perform two point-in-circle tests. The touch is valid (within the ring) if it is both outside the inner circle and inside the outer circle. A point p ...


0

After experimenting long time, I come to conclusion, it is not possible to catch isKeyJustPressed method without implementing input processor. So i have used isKeyPressed method only, without implementing InputProcessor in my Screens. I have used a boolean flag to get to know, if back button is continuously pressed pressed from last screen, so that I won't ...



Top 50 recent answers are included