Answer the question
In order to leave comments, you need to log in
How to remove certain nodes from the scene in SpriteKit?
There is class Renderer: SKScene
also a function drawField(field: Field)
that draws cubes on the stage.
override func didMove(to view: SKView) {
drawField(field: fieldTop)
drawField(field: fieldBottom)
setPlayerInfo(text: "STEPS", x_position: -90, y_position: 360, verticalAlignmentMode: .top, horizontalAlignmentMode: .right)
setPlayerInfo(text: "TIME", x_position: 100, y_position: 360, verticalAlignmentMode: .top, horizontalAlignmentMode: .left)
}
fieldBottom
constantly re-render (fieldBottom is a node that consists of many cubes, like in a Match 3 game) because the user moves these cubes? override func update(_ currentTime: TimeInterval) {
clearField()
drawField(field: fieldBottom)
}
clearField()
so that it only deletes the nodesfieldBottom
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question