accelerometer

Game Editor comments and discussion.

accelerometer

Postby Fojam » Tue Jul 20, 2010 1:59 am

how do you use the accelerometer variable? id like to integrate it in one of my games
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: accelerometer

Postby jimmynewguy » Tue Jul 20, 2010 2:34 am

This demo was in the Beta - akr made it i beleive :)
Attachments
accel.zip
(410.68 KiB) Downloaded 285 times
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: accelerometer

Postby Fojam » Tue Jul 20, 2010 1:43 pm

thanks thats exactly what I was looking for
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: accelerometer

Postby makslane » Wed Jul 21, 2010 6:35 pm

Use the getAccelerometer function to get the value from the accelerometer (on the desktop get the joystick axis values).

Declaration:
Code: Select all
Vector getAccelerometer()
The Vector is a struct with the follow members:

x: -1.0 to 1.0
y: -1.0 to 1.0
z: -1.0 to 1.0



Syntax:
Code: Select all
Vector v = getAccelerometer();
x = v.x;
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: accelerometer

Postby DST » Wed Jul 21, 2010 6:51 pm

The getaccelerometer function works for my joystick in windows, and doesn't require any translation of the variables like joystickaxis does.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron