ios - Increasing an integer upon collision with an object. Swift -


i have code creates , prints score game, want score increase upon collision object. , despite best efforts, cannot seen figure out how it.

this code deals score:

import spritekit  public class score {     public let label = sklabelnode(fontnamed: "chalkduster")      private var currentscore = 0      public func setup (fontsize: cgfloat, x: cgfloat, y: cgfloat) {         label.fontsize = fontsize         label.position.x = x         label.position.y = y         setscore(currentscore)     }      public func setscore(value: int) {         currentscore = value         label.text = string(currentscore)     }      public func incrementscore(value: int) {         setscore(currentscore + value)     } } 


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -