Commit b2db7963 authored by Timothée Giet's avatar Timothée Giet

canal_lock, fix moving boat while doors are moving

parent 5cd004f6
......@@ -432,13 +432,13 @@ ActivityBase {
return
boat.duration = water.duration
var prevState = boat.state
if(boat.state == "left" && door1.state == "open")
if(boat.state == "left" && door1.opened)
boat.state = "middleDown"
else if(boat.state == "middleUp" && door2.state == "open")
else if(boat.state == "middleUp" && door2.opened)
boat.state = "right"
else if(boat.state == "right" && door2.state == "open")
else if(boat.state == "right" && door2.opened)
boat.state = "middleUp"
else if(boat.state == "middleDown" && door1.state == "open")
else if(boat.state == "middleDown" && door1.opened)
boat.state = "left"
if(prevState !== boat.state)
......
......@@ -36,6 +36,7 @@ Rectangle {
property int minHeight
property int maxHeight
property int duration
property bool opened: height == minHeight
Behavior on height { NumberAnimation { duration: lock.duration } }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment