Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Game control interface for Android phone/tablet games  (Read 3355 times)
0 Members and 1 Guest are viewing this topic.
Offline Norakomi
« Posted 2014-04-20 16:30:24 »

Hi,

First post on JGO.
I'm a beginning java/android programmer & currently working together with my brother & another friend on a 2D vertical scolling shooter as well as a 2D platform games based on 2 old Konami MSX games (Knightmare & The Goonies).

<a href="http://www.youtube.com/v/sWrWxdr0SIs?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/sWrWxdr0SIs?version=3&amp;hl=en_US&amp;start=</a>

We're coding & testing our games in Eclipse and currently using the keyboard input to move our heros around and to shoot or punch.

I'm thinking about how we should incorporate a game controller in the future that enables the game to be played on a tablet or phone.(like a virutal on screen controller or moving our tablet/phone combined with tapping or whatelse is there..)

Thought I put out a post here.
Maybe you could give me some good ideas for how to create one.
Links, resources, code, tutorials.

<a href="http://www.youtube.com/v/ytoPfZyMNeM?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/ytoPfZyMNeM?version=3&amp;hl=en_US&amp;start=</a>

Norakomi Retro Games Projects at: http://norakomi.blogspot.nl/
Norakomi on Google Play
Offline QuicK

Junior Devvie





« Reply #1 - Posted 2014-04-22 22:29:02 »

I can't offer any resources or advice on how to actually create this, however; if I were designing the game, I would probably either:

1) use a left/right tilt system to move the character back and forth and tap to shoot.
2) have a digital joystick and a fire button to move the player around

I would assume that android APIs have the tilting somewhat built-in, and the joystick you'll just have to do a little bit of trig to get it right.

Hope this helps you get started Smiley
Offline ImTroyMiller
« Reply #2 - Posted 2014-05-29 00:40:11 »

Are you using any framework or have you built your own?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Norakomi
« Reply #3 - Posted 2014-05-30 11:41:45 »

I'm using LibGDX as my main library...

Norakomi Retro Games Projects at: http://norakomi.blogspot.nl/
Norakomi on Google Play
Offline ImTroyMiller
« Reply #4 - Posted 2014-06-01 01:59:03 »

I'm using LibGDX as my main library...

You can either implement "Input", or you can access it directly like I do.  This is how I get input from a button that I have drawn to the screen...

1  
2  
3  
4  
5  
if (Gdx.input.isTouched()){
        if (Gdx.input.getX() > 800 && Gdx.input.getX() < 870 && Gdx.input.getY() > 34 && Gdx.input.getY() < 104) { //This is true if the screen is touched between 800x-870x and between 34y-104y
              //Do an action or something
        }
}


However, you'll want to set it up so that the coordinates work on all phones.  Let me know if you want to know how.
Offline UprightPath
« Reply #5 - Posted 2014-06-01 04:58:48 »

In libGDX there is also a UI Widget called a TouchPad. It acts like a Joystick.

Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (24 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!