Forums

OverviewV-Play 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
    V-Play 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 3 years, 3 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.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support