Control Player with Tilt the phone

Talk about making games.

Control Player with Tilt the phone

Postby Behdadsoft » Sat May 10, 2014 10:36 am

Hi.
I want make a game (Space Invaders) for iPhone and need control spaceship with Crooked ِDevice (Tilt the phone) but I don't know how can do it.

Please Guide Me.

Thanks A Lot.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Control Player with Tilt the phone

Postby Goettsch » Sat May 10, 2014 11:27 am

hi,
add this code to player-->draw actor

Code: Select all
Vector v = getAccelerometer();
if(v.x>0.2) // moving right
{
    x+=5;
}
else if(v.x<-0.2)
{
    x-=5;
}


this will make your spaceship move left and right
Support me and open these links:
http://adf.ly/pZps0 (as many times as you can)
http://VisitsToMoney.com/index.php?refId=470333 (open once)
http://Visitors2Cash.com/ref.php?refId=169224 (open once)
My games:
Kingdoms of... http://adf.ly/pZq5O
Goettsch
 
Posts: 124
Joined: Fri Jun 28, 2013 10:00 pm
Score: 5 Give a positive score

Re: Control Player with Tilt the phone

Postby Behdadsoft » Fri May 23, 2014 6:40 pm

Thanks Goettsch.

I test it on Android but don't work. :(
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Control Player with Tilt the phone

Postby MrJolteon » Fri May 23, 2014 6:43 pm

Android's not really supported yet. A lot of features are still missing.
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Control Player with Tilt the phone

Postby Behdadsoft » Fri May 23, 2014 7:04 pm

thanks. this feature currently work on iphone?
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Control Player with Tilt the phone

Postby MrJolteon » Fri May 23, 2014 7:33 pm

From what I've read, yes.
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Control Player with Tilt the phone

Postby Behdadsoft » Sat May 24, 2014 4:53 am

Thanks.

MrJolteon +1

Goettsch +1
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Control Player with Tilt the phone

Postby Zivouhr » Sat May 31, 2014 2:15 am

Will keep this option in mind for future games, thanks for posting the tips.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron