Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- userInput.setOnKeyListener(new OnKeyListener(){
- @Override
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- if (event.getAction() == KeyEvent.ACTION_DOWN) {
- lastInput = (char)event.getUnicodeChar();
- return false;
- }
- return true;
- }
- });
- enterLetterButton.setOnClickListener(new OnClickListener(){
- public void onClick(View arg0) {
- guess(lastInput);
- }
- });
- public void guess(char guess) {
- if (text.toString().indexOf(lastInput) != -1) {
- text.setSpan(new ForegroundColorSpan(Color.BLACK), 0, text.length(), 0);
- }
- // if all-show gameEnd();
- else {
- showImages();
- }
- }
Add Comment
Please, Sign In to add comment