0 Favourites

# elevator and touch

• 9 posts
• how do i create stering the elevator with a crank by touch like in this pic. <img src="https://dl.dropboxusercontent.com/u/44710358/start_0.gif" border="0" />

• You could make it so that the 'origin point' moves to where the 'touch site' (forgotten the exact event for that) is and then make it so that when it has say "turned 360 degrees" raise it by X amount or rather "for every X degrees move elevator up"

• Sulli it will work?

• Your problem was fun to solve :)

I didn't move any origin point, but I use a "handle" point and a origin point. I also had to use the "relative angle" of the sprite, the angle from 0 degree (original angle) and the handle, to synchronise with the touch.

here is the capx

• Guizmus its complete ! how can i change speed of lift, 3-4x slower? because when i turn crank elevator goes too fast

• Download my capx again, I added a textbox to set the "liftSpeed" variable on the go.

I set the speed to 1 when I gave you my capx at first, but you just have to reduce it to 0.5, or 0.2, or whatever fits :) try some values with the textbox, then use the more appropriate one !

Ho, and for anyone who takes a look at it, there are a lot of explications inside the capx, so you should be able to reproduce it/adapt it on lots of other situations.

• Guizmus thats great!! your lift goes well

I wonder how modify your lift to:

when i rotate a crank in Events add 1 to variable called 'elevatordown' and when 'elevatordown' variable is greater than 0 elevator automaticaly goes down.

Every move of elevator substract 0.1 from 'elevatordown' variable

Did you have any tips for me at start?

• Well, I moved the elevator directly by using a "move X pixel at the Y angle".

You can replace it by calling a function "ElevatorMove", 2 parameters given (angle and distance) (add a 3rd param with lift.UID if you need).

That function can then move the lift using whatever you want (8 direction behavior? custom movement ? everything is possible).

As the "touch" isn't easy for the user to be precise, you can also just set a moving speed up if cranck is going on one side, speed down else, just to "smooth" things a little.

I'm not sure I answered you, I may have misunderstood what you asked.