難しいです。初めて見る手法とかがヒントになっていてとまどうばかりでした。考え方はすんなりいくんですけれど、それをコードに表現するのが難しいですね。
// 対称な星@コードを学ぼう3 let animals = [A, B, C, D, E, F] var lastPlacePosition = Point(x: 0, y: 0) func addImage(touch: Touch) { let placeDistance = touch.position.distance(from: lastPlacePosition) if placeDistance < 80 { return } lastPlacePosition = touch.position // Graphics for each quadrant. var graphics: [Graphic] = [] // Pick a random image. let chosenImage = animals.randomItem // Create graphics and add to array. for i in 0 ..< 4 { let graphic = Graphic(image: chosenImage) graphics.append(graphic) } // Get absolute x, y values. let x = abs(touch.position.x) let y = abs(touch.position.y) // Position a graphic in each quadrant. let position1 = Point(x: x, y: y) let position2 = Point(x: x, y: -y) let position3 = Point(x: -x, y: y) let position4 = Point(x: -x, y: -y) for i in 0 ..< 4 { if i == 0 { scene.place(graphics[i], at: position1) } else if i == 1 { scene.place(graphics[i], at: position2) } else if i == 2 { scene.place(graphics[i], at: position3) } else { scene.place(graphics[i], at: position4) } } }