Changeset View
Changeset View
Standalone View
Standalone View
src/activities/submarine/Submarine.qml
Context not available. | |||||
119 | id: tutorial | 119 | id: tutorial | ||
---|---|---|---|---|---|
120 | anchors { | 120 | anchors { | ||
121 | top: parent.top | 121 | top: parent.top | ||
122 | topMargin: background.height / 6 | 122 | topMargin: 10 | ||
123 | right: parent.right | 123 | right: parent.right | ||
124 | rightMargin: 5 | 124 | rightMargin: 5 | ||
125 | left: parent.left | 125 | left: parent.left | ||
Context not available. | |||||
541 | id: upperGate | 541 | id: upperGate | ||
542 | visible: (bar.level > 1) ? true : false | 542 | visible: (bar.level > 1) ? true : false | ||
543 | width: background.width / 18 | 543 | width: background.width / 18 | ||
544 | height: isGateOpen ? background.height * (5 / 36) : background.height * (5 / 12) + 4 | 544 | height: isGateOpen ? background.height * (5 / 36) : background.height * (5 / 12) | ||
545 | y: -2 | 545 | y: -2 | ||
546 | z: 2 | 546 | z: 1 | ||
547 | color: "#9E948A" | 547 | color: "#848484" | ||
548 | border.color: "#766C62" | 548 | border.color: "black" | ||
549 | border.width: 2 | 549 | border.width: 3 | ||
550 | anchors.right: background.right | 550 | anchors.right: background.right | ||
551 | anchors.rightMargin: -2 | | |||
552 | 551 | | |||
553 | property bool isGateOpen: false | 552 | property bool isGateOpen: false | ||
554 | 553 | | |||
Context not available. | |||||
586 | width: background.width / 18 | 585 | width: background.width / 18 | ||
587 | height: background.height * (5 / 12) - subSchemaImage.height / 1.4 | 586 | height: background.height * (5 / 12) - subSchemaImage.height / 1.4 | ||
588 | y: background.height * (5 / 12) | 587 | y: background.height * (5 / 12) | ||
589 | color: "#9E948A" | 588 | color: "#848484" | ||
590 | border.color: "#766C62" | 589 | border.color: "black" | ||
591 | border.width: 2 | 590 | border.width: 3 | ||
592 | anchors.right:background.right | 591 | anchors.right:background.right | ||
593 | anchors.rightMargin: -2 | | |||
594 | 592 | | |||
595 | Body { | 593 | Body { | ||
596 | id: lowerGateBody | 594 | id: lowerGateBody | ||
Context not available. | |||||
613 | } | 611 | } | ||
614 | } | 612 | } | ||
615 | 613 | | |||
616 | Rectangle { | 614 | Item { | ||
617 | id: subSchemaImage | 615 | id: subSchemaItems | ||
618 | width: background.width/1.3 | 616 | | ||
619 | height: background.height/4 | 617 | Image { | ||
620 | x: background.width/9 | 618 | id: subSchemaImage | ||
621 | y: background.height/1.5 | 619 | source: url + "sub_schema.svg" | ||
622 | visible: false | 620 | width: background.width/1.3 | ||
621 | height: background.height/4 | ||||
622 | x: background.width/9 | ||||
623 | y: background.height/1.5 | ||||
624 | } | ||||
623 | } | 625 | } | ||
624 | 626 | | |||
625 | Image { | 627 | Image { | ||
626 | id: crown | 628 | id: crown | ||
627 | 629 | | |||
628 | width: submarineImage.width * 0.85 | 630 | width: submarineImage.width * 0.85 | ||
629 | height: width * 0.5 | 631 | height: width * 0.55 | ||
630 | sourceSize.width: width | 632 | | ||
631 | sourceSize.height: height | | |||
632 | visible: ((bar.level > 2) && !isCaptured) ? true : false | 633 | visible: ((bar.level > 2) && !isCaptured) ? true : false | ||
633 | source: url + "crown.svg" | 634 | source: url + "crown.png" | ||
634 | 635 | | |||
635 | property bool isCaptured: false | 636 | property bool isCaptured: false | ||
636 | 637 | | |||
Context not available. | |||||
690 | fillMode: Image.PreserveAspectFit | 691 | fillMode: Image.PreserveAspectFit | ||
691 | 692 | | |||
692 | visible: (bar.level > 3) ? true : false | 693 | visible: (bar.level > 3) ? true : false | ||
693 | source: collided ? url + "boat-hit.svg" : url + "boat.svg" | 694 | source: url + "boat.svg" | ||
694 | x: initialXPosition | 695 | x: initialXPosition | ||
695 | z: 1 | 696 | z: 1 | ||
696 | 697 | | |||
Context not available. | |||||
780 | id: rock2 | 781 | id: rock2 | ||
781 | width: background.width / 6 | 782 | width: background.width / 6 | ||
782 | height: width * 0.48 | 783 | height: width * 0.48 | ||
783 | z: 5 | | |||
784 | 784 | | |||
785 | visible: (bar.level > 4) ? true : false | 785 | visible: (bar.level > 4) ? true : false | ||
786 | anchors.bottom: crown.bottom | 786 | anchors.bottom: crown.bottom | ||
Context not available. | |||||
832 | id: rock1 | 832 | id: rock1 | ||
833 | width: rock2.width | 833 | width: rock2.width | ||
834 | height: width * 0.46 | 834 | height: width * 0.46 | ||
835 | z: 5 | | |||
836 | visible: (bar.level > 6) ? true : false | 835 | visible: (bar.level > 6) ? true : false | ||
837 | anchors.bottom: crown.bottom | 836 | anchors.bottom: crown.bottom | ||
838 | anchors.right: space.left | 837 | anchors.right: space.left | ||
Context not available. | |||||
870 | } | 869 | } | ||
871 | } | 870 | } | ||
872 | 871 | | |||
873 | Image { | | |||
874 | id: rock3 | | |||
875 | width: background.width | | |||
876 | height: background.height * 0.25 | | |||
877 | sourceSize.width: width | | |||
878 | sourceSize.height: height | | |||
879 | | ||||
880 | visible: (bar.level > 2) ? true : false | | |||
881 | anchors.top: crown.top | | |||
882 | anchors.horizontalCenter: crown.left | | |||
883 | // anchors.topMargin: height * 0.5 | | |||
884 | source: url + "rocks.svg" | | |||
885 | } | | |||
886 | | ||||
887 | Timer { | 872 | Timer { | ||
888 | /* | 873 | /* | ||
889 | * A delay is used since on setting fullscreen on/off | 874 | * A delay is used since on setting fullscreen on/off | ||
Context not available. | |||||
902 | 887 | | |||
903 | Controls { | 888 | Controls { | ||
904 | id: controls | 889 | id: controls | ||
905 | z: 10 | | |||
906 | enginePosition.x: background.width * 0.2 | 890 | enginePosition.x: background.width * 0.2 | ||
907 | enginePosition.y: background.height - bar.height - (engineHeight * 1.6) | 891 | enginePosition.y: background.height - bar.height - (engineHeight * 1.25) | ||
908 | engineWidth: background.width / 8 | 892 | engineWidth: background.width / 8 | ||
909 | engineHeight: 100 | 893 | engineHeight: 100 | ||
910 | submarineHorizontalSpeed: submarine.currentFinalVelocity * 1000 | 894 | submarineHorizontalSpeed: submarine.currentFinalVelocity * 1000 | ||
911 | 895 | | |||
912 | leftTankVisible: bar.level >= 7 ? true : false | 896 | leftTankVisible: bar.level >= 7 ? true : false | ||
913 | leftBallastTankPosition.x: background.width * 0.4 | 897 | leftBallastTankPosition.x: background.width * 0.4 | ||
914 | leftBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.6) | 898 | leftBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.25) | ||
915 | leftBallastTankWidth: background.width / 8 | 899 | leftBallastTankWidth: background.width / 8 | ||
916 | leftBallastTankHeight: 120 | 900 | leftBallastTankHeight: 100 | ||
917 | 901 | | |||
918 | centralTankVisible: bar.level < 7 ? true : false | 902 | centralTankVisible: bar.level < 7 ? true : false | ||
919 | centralBallastTankPosition.x: background.width * 0.5 | 903 | centralBallastTankPosition.x: background.width * 0.5 | ||
920 | centralBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.6) | 904 | centralBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.25) | ||
921 | centralBallastTankWidth: background.width / 8 | 905 | centralBallastTankWidth: background.width / 8 | ||
922 | centralBallastTankHeight: 120 | 906 | centralBallastTankHeight: 100 | ||
923 | 907 | | |||
924 | rightTankVisible: bar.level >= 7 ? true : false | 908 | rightTankVisible: bar.level >= 7 ? true : false | ||
925 | rightBallastTankPosition.x: background.width * 0.6 | 909 | rightBallastTankPosition.x: background.width * 0.6 | ||
926 | rightBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.6) | 910 | rightBallastTankPosition.y: background.height - bar.height - (engineHeight * 1.25) | ||
927 | rightBallastTankWidth: background.width / 8 | 911 | rightBallastTankWidth: background.width / 8 | ||
928 | rightBallastTankHeight: 120 | 912 | rightBallastTankHeight: 100 | ||
929 | 913 | | |||
930 | divingPlaneVisible: true | 914 | divingPlaneVisible: true | ||
931 | divingPlanePosition.x: background.width * 0.8 | 915 | divingPlanePosition.x: background.width * 0.8 | ||
932 | divingPlanePosition.y: enginePosition.y + (engineHeight * 0.5) - (divingPlaneHeight * 0.5) | 916 | divingPlanePosition.y: background.height - bar.height - engineHeight | ||
933 | divingPlaneWidth: background.width * 0.1 | 917 | divingPlaneWidth: background.width / 8 | ||
934 | divingPlaneHeight: divingPlaneWidth * 0.33 | 918 | divingPlaneHeight: divingPlaneWidth * 0.2 | ||
935 | buttonSize: subSchemaImage.height * 0.2 | | |||
936 | buttonPlusY: enginePosition.y - (buttonSize * 0.5) | | |||
937 | buttonMinusY: enginePosition.y + engineHeight - (buttonSize * 0.5) | | |||
938 | } | 919 | } | ||
939 | 920 | | |||
940 | DialogHelp { | 921 | DialogHelp { | ||
Context not available. |