elevator and touch

0 favourites
  • 9 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • 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?

  • delgado

    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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • delgado

    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?

  • delgado

    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.

  • Awesome!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)