Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Modifying the Car Challenge control to a like 2D action RPG control

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9742

    Eduardo

    Hi, I’m searching since some days ago a way to modify the control of the Car Challenge demo.

    By default, when press to left or right the cars rotate, and I want to change that behavior to a like action RPG control like Zelda: A link to the past or Soleil.

    I just want when I press to left, the cars move to left, when I press to right, the cars move to right, instead of the default rotation behavior. And obviously, when I press down, the cars move to the bottom of the area or the window.

    I doesn’t mind if the cars don’t rotate automatically after doing the changes.

    #9750

    Alex
    Felgo Team

    Hi,

    there are numerous ways for creating such movement, the CarChallange demos using physics and the keys are modifying the physical properties force and torque of the car collider.

    force: Qt.point(twoAxisController.yAxis*8000, 0)
    torque: twoAxisController.xAxis*2000
    

    You could remove the torque and instead do something like this on the force:

    force: Qt.point(twoAxisController.xAxis*6000, twoAxisController.yAxis*6000)
    

    Now the car won’t rotate but only move in x and y direction.

    You could also e.g. use a MovementAnimation to move the character constantly if a key was pressed.

    Cheers,
    Alex

    • This reply was modified 5 years, 4 months ago by  Alex.
    #9756

    Eduardo

    Thank you very much. Putting a negative value to y Axis I get the thing I want.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.