Accelerometer function How - to
RussianMoney
Member Posts: 4
Hi all, would it be possible to make a simple how to for using the accelerometer function on Gamesalad? I am having trouble understanding how it works. If you could do something like simulate an actors movement left-right-forward-backwards using the accelerometer it would be so very helpful.
Thanks!!!
Thanks!!!
Comments
Is there a proxy we can create that allows for one set of controls to be used for testing/playing on the MAC and then have them translated to accelerometer functions when they are exported to the phone?
An example would be that the arrow keys are used on the iPhone and when the games is exprted those are translated to accelerometer function.
Sorry if this is answered elsewhere on the board.
$e*
I am having a peculiar problem here though, might be hardware but it is a brand new 3G and I have had no other problems to date.
First off I notice that there is an expression in the Speed field of MOVE. Could you explain what that is?
My problem involve something simple. I copy this rule and drop in an integer (where I notice your expression is) and it works fine.
If I reverse the multiplier in the attribute change (from -0.1 to 0.1 and I flop the directional vector I do not get the reverse effect.
that would be awesome to test some functionalities on the game.
did i do something wrong or is it just no compatible?
that would be incredibly time saving.
If you are implementing simple rules to make a tilt Right -> Move Right and Tilt left ->Move left function the BASIC rules set up in the turtorial is correct for one direction.
To implement the OPPOSET direction though you have to think not just in numbers but GEOMETRICALLY. So if you reverce the conditional integer from -0.1 to 0.1 you also have to invert the changed condition so rather than "Less than" it needs to be "Greater than"
I have a fully funtional control set now using this simple logic
I tried to implement this last night, but got nowhere fast - I'm not geometrically or mathematically inclined alas!
It did, however, inspire a whole new control system for one of my works in progress - and all it used no accelerometers at all!
EDIT: Additionally, I found the responsiveness to be a little lacking using the accelerometers - but that could just be me getting it a whole heap of wrong
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I have found some lag as well but I want to experiment with something other than a simple "Move".
$e*
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Essentially, you press anywhere on the screen, and the actor moves towards that spot as long as you hold the mouse button down.
This was nice because you could make the actor move left, for example, by holding down a spot on the screen anywhere to the left of it (i.e. right next to the actor's left, or right on the edge of the screen - or anywhere in-between).
It seemed more accurate than using the accelerometer, but again, that might be because I was doing it wrong!
I'm setting up a targetX and targetY variable, and then constraining those to the mouse. I then make the actor move towards targetX and targetY. Or something *like* that.
If you want to try it out and get stuck, let me know and I'll write something more useful up
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Dammit - there's *another* idea for a game!
EDIT: ACTUALLY, thinking about it, it's like the control on Nintendo DS games like Zelda and Animal Crossing.
That Nintendo is VERY clever!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Do I need to create an attribute to link Accelerometer.Z to player rotation?
I *still* can't wrap (pun intended) my head around scrolling backgrounds and other stuff that other find incredibly easy to do!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
If you want to try it out and get stuck, let me know and I'll write something more useful up ]
Hey Quantum!
I love the idea of your control scheme as quoted above
Would you mind writing up a tutorial or showing screens of how you did this! I am making a game that could make very good use of this as oppose to the accelerometer or D-Pad
Also, quick question on the D-Pad, does it show up on the Ipod/Itouch as visible? Or is it mapped to the screen as invisible?
http://gamesalad.com/wiki/game_attributes
Quantum, if you see this, I would still like to see your examples of actor moving towards target x, and target y
Sorry I can't help you right now - I'm reading this at work, working late the next two days then away for the weekend! Busy busy sheepy!
Off the top of my head, just put a rule on your actor that says:
If the mouse button is held down
Then add the Move To behaviour and for position, put:
> game.mouse.position.X ^ game.mouse.position.Y
That should essentially do it.
Hope that helps, sorry I can't help more right now.
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
How come this link does not work?
http://gamesalad.com/wiki/how_to_gsc_iphone_controls#how_do_i_make_use_of_the_iphone_ipod_touch_accelerometer