diff --git a/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift b/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift index 9d9f43b571..ce04d3fdd2 100644 --- a/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift +++ b/Modules/GameEngineKit/Sources/_NewSystem/Views/DragAndDrop/DragAndDropBaseScene.swift @@ -175,6 +175,7 @@ class DragAndDropBaseScene: SKScene { group.notify(queue: .main) { self.onDropAction(node) } + disableWrongAnswer(node) } func onDragAnimation(_ node: SKSpriteNode) { @@ -193,6 +194,14 @@ class DragAndDropBaseScene: SKScene { selectedNodes = [:] } + private func disableWrongAnswer(_ node: DraggableImageAnswerNode) { + let gameplayChoiceModel = viewModel.choices.first(where: { $0.choice.value == node.name })! + if gameplayChoiceModel.choice.dropZone == nil { + node.colorBlendFactor = 0.4 + node.isDraggable = false + } + } + override func didMove(to view: SKView) { self.reset() }