Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / What does GetDirectionX and GetDirectionY return?

Author
Message
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 4th Apr 2012 18:13
I am wondering what gets returned for GetDirectionX and GetDirectionY?
Is it just -1, 0, 1 to indicated direction or does it return various numbers based on the angle of the phone?
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 4th Apr 2012 18:40
It returns a float btween -1 and 1 wich is the current angle of the phone
polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 4th Apr 2012 18:42
I believe GetDirectionAngle() and GetDirectionSpeed() may also need to be used. I'm not 100% sure as I am currently playing about with those functions too,

Blackberry App Development & ZX Spectrum Game Development.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 4th Apr 2012 18:56
Since it is based on the accelerometer it can also return values above 1 or below -1 if you manage to apply an acceleration greater than gravity. Most likely cause of this is violent shaking of the device.
polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 4th Apr 2012 18:58
Hmm, now I just need to figure out a game use for violent shaking,

Blackberry App Development & ZX Spectrum Game Development.
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 4th Apr 2012 19:36
Quote: "
Hmm, now I just need to figure out a game use for violent shaking,
"


I believe that would be "The Simpsons Whacking Day" game.

I couldn't get the accelerometer to work with gravity greater than 0.

Thanks for the answers.
polomint
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location: Lancashire, United Kingdom
Posted: 4th Apr 2012 20:05
ooo, I know... Advanced Earthquake Simulator (C)

Blackberry App Development & ZX Spectrum Game Development.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Apr 2012 20:24
Where can I get "The Simpsons Whacking Day" game?

I'm betting it's great!

Cheers,
Ancient Lady
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 5th Apr 2012 06:32
The game doesn't exist. I just took the name from the episode name when they were whacking the snakes. It would be a pretty fun game IMO.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Apr 2012 20:03
Doh!!!

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-11-23 07:51:22
Your offset time is: 2024-11-23 07:51:22