Thumbstick-template (with capx)

  • LittleStain

    How would you set player tilt to the bullet behavior controls? I've been trying to get my helicopter sprite to tilt back or forth in the direction of travel, but the closest I've gotten in getting it to tilt in only one direction and it gets stuck there.

    System | Copter.Bullet.Angle of Motion = 0 | Copter | Rotate 1 degrees toward 10

    System | Copter.Bullet.Angle of Motion = 180 | Copter | Rotate 1 degrees toward -10

    System | Copter.Bullet.Speed = 0 | Copter | Rotate 1 degrees toward 0

    I don't see that doesn't work. Help, please?

  • Boony

    I'm not sure what you are trying to achieve, so I can't give a straight answer.

    But what I do see in your code is that you use = which means it will only rotate if the angle of motion is exactly 0.

    Seems to me that isn't what you want, but I can't be sure for I don't see what you are trying to do..

  • LittleStain

    I'm just trying to make a helicopter tilt slightly in the direction of travel. It's a side scrolling rescue game using your bullet behavior controls. So if the helicopter moves forward, it tilts forward and if it moves back, it tilts back. No tilting on up or down movement.

    If I can't use exactly 0, how do I express a range of numbers and make it work?

  • How about greater than or equal to, and less than or equal to instead of =. so <= or >=

  • BluePhaze

    I'm confused. Since angle of motion is circular, isn't everything greater or lesser than a number?

    I tried it with 2 contitions each:

    If Copter.Bullet.AngleOfMotion Lesser or equal to 45 and

    If Copter.Bullet.AngleOf Motion is Greater or equal to 315 then

    Copter Rotate 1 degree toward 10

    If Copter.Bullet.AngleOfMotion Lesser or equal to 225 and

    If Copter.Bullet.AngleOf Motion is Greater or equal to 135 then

    Copter Rotate 1 degree toward -10

    If Copter.Bullet.Speed Less than 2 then Copter Rotate 1 degree toward 0

    That didn't work though.

  • LittleStain

    BluePhaze

    Edit: RamPackWobble was able to help me in another thread. If anyone is looking to add tilt functionality to the bullet behavior, please view the thread here:

    Thumbstick with tilt

    It doesn't have to be used with only a helicopter. Having a character slightly tilt forward when they run might give the impression they are running faster.

    Thanks again to LittleStain for making these amazing thumbstick controls! I've tried so many others and these are my favorites!

  • LittleStain

    you simply made my day, oh sorry my week, sorry again my month, and you don't even know , then yes let me tell you, haha, thx so much. I was looking for this from last i think 1.5 months. I really want to hug you and show my love and respect at the same time. Thanks for sharing such a gem with us. I will learn so much from that. I will look into it for sure. Thanks so much.

  • Exactly what I needed!

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the compliments guys..

  • LittleStain - I just want to thank you & all the guys who have contributed to this and the other thumbstick tuts. The graphics are great, and this is fantastic to help in my current 1st project! Many thanks!

  • awessomeee awesomme tysm u earning so much good karma!!

  • Thanks! One can never have enough good Karma..

  • really helpful.thnx LittleStain

  • Thanks! One can never have enough good Karma..

    Is there a plugin needed for this? I cannot recreate your thumbstick with the 8 direction behavior. I have tried it on several blank construct 2 projects.

  • > Thanks! One can never have enough good Karma..

    >

    Is there a plugin needed for this? I cannot recreate your thumbstick with the 8 direction behavior. I have tried it on several blank construct 2 projects.

    No plugin is needed.

    The 8-direction implementation is in the capx and it works as expected.

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