submarine: Fix submarine taking input on tutorial

Authored by rudranilbasu on Aug 14 2017, 6:03 PM.

Description

submarine: Fix submarine taking input on tutorial

The controls of the submarine was getting affected even when the
tutorial is still visible, which is avoided by placing a

!tutorial.visible

check for both keyboard inputs and MouseArea inputs. The input won't
be a valid one if tutorial.visible returns true.

In 42e9414 "submarine: Improved coding structure", the label under a
Ballast tank was placed in a separate Rectangle component present under
the Ballast tank. This resulted in the bar overriding the ballast tank
labels. The approach is changed by making the GCText component as a
child of the Ballast tank itself, instead of creating a new Rectangle
component under it.

On changing the level while the smoothHorizontalVelocity is still
running, the effect would get reflected on the next level, since
the animation is still running.

Avoiding this by calling smoothHorizontalVelocity.stop() under
resetSubmarine() function.

Crown capturing and upper gate opening and closing is done directly
by changing the property, to avoid breaking the binding.

Signed-off-by: Rudra Nil Basu <rudra.nil.basu.1996@gmail.com>

Details

Committed
rudranilbasuAug 14 2017, 6:03 PM
Parents
R2:2127d20c8ee9: submarine, minor code refactor
Branches
Unknown
Tags
Unknown
Restricted Application added a subscriber: jjazeix. ยท View Herald TranscriptAug 14 2017, 6:26 PM
jjazeix added inline comments.Aug 15 2017, 3:33 PM
/src/activities/submarine/Controls.qml
97

it should be the same but changing the enabled property seems better for the meaning

rudranilbasu marked an inline comment as done.Aug 15 2017, 3:45 PM
rudranilbasu added inline comments.
/src/activities/submarine/Controls.qml
97

Fixed in bb56197