Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 21796 times)
0 Members and 1 Guest are viewing this topic.
Offline Norakomi
« Posted 2014-04-20 16:30:24 »


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=";hl=en_US&amp;start=" target="_blank">;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=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>

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...

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...

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  

nelsongames (15 views)
2018-04-24 18:15:36

nelsongames (12 views)
2018-04-24 18:14:32

ivj94 (587 views)
2018-03-24 14:47:39

ivj94 (49 views)
2018-03-24 14:46:31

ivj94 (392 views)
2018-03-24 14:43:53

Solater (64 views)
2018-03-17 05:04:08

nelsongames (110 views)
2018-03-05 17:56:34

Gornova (167 views)
2018-03-02 22:15:33

buddyBro (715 views)
2018-02-28 16:59:18

buddyBro (93 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!