Forums

OverviewV-Play 1 SupportPath movement with dynamic input › Reply To: Path movement with dynamic input

OverviewV-Play 1 SupportPath movement with dynamic input › Reply To: Path movement with dynamic input
#6574

PanflamCutie

Hi,

I kind of already realized it with Path Movement. It looks like this:

property int xPoint: 1
    property int yPoint: 0
    property int actualPosX: column*gridSize;
    property int actualPosY: row*gridSize;

    PathMovement {
        velocity: 100 // Geschwindigkeit
        rotationAnimationDuration: 200
           waypoints: [
               { x: actualPosX, y: actualPosY},
               { x: xPoint*gridSize, y: yPoint*gridSize}//xPoint(column)  yPoint(row)
           ]

           onWaypointReached: { // add logic!!!!!
               column = xPoint
               row = yPoint

               chooseDirection()

               move()
           }

           onPathCompleted: {
               start()
           }
       }

It works quite well (I still must add some conditions, whether if the entity is allowed to get to this field or not), but I have a problem now with the rotation, because its rotation-origin is at the left-down-corner (I think it’s that one), but it should turn with its center as origin.

 

Best regards,
PanflamCutie

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