Forums

OverviewV-Play 1 SupportMultitouchArea only 2 points › Reply To: MultitouchArea only 2 points

OverviewV-Play 1 SupportMultitouchArea only 2 points › Reply To: MultitouchArea only 2 points
#5106

Philipp

Hi!

 

This is the code of the MultiTouchArea found in our Player.qml file. In four player mode, four Player objects exist.

 

MultiTouchArea {
        id: mouse
        enabled: !ai
        anchors.centerIn: parent
        width: scene.level.fourPlayers? parent.width * 2 : parent.width * 5
        height: scene.level.fourPlayers? parent.width * 1.1 : parent.height * 5

        multiTouch.target: parent
        multiTouch.dragAxis: MultiTouch.YAxis
        multiTouch.maximumY: scene.height-parent.height
        multiTouch.minimumY: 0

        //onPressed: playerLeft.state = "MOVE"
        //onPositionChanged: console.log("Player X/Y: " + playerLeft.x + "/" + playerLeft.y);
        onReleased: {
            if(shootAllowed){
                PlayerLogic.shootSnowball(parent)
                snowballsShot++;
            }
        }
    }

 

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