File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ class GameFieldView: UIView {
3030 segmentViews. append ( segmentView)
3131
3232 } else {
33- segmentViews [ index] . segment = segment
33+
34+ if segmentViews [ index] . segment. rect != segment. rect {
35+ segmentViews [ index] . segment = segment
36+ }
3437 }
3538 }
3639 }
@@ -61,11 +64,8 @@ class SegmentView: UIView {
6164
6265 var segment : GameSegment ! {
6366 didSet{
64- frame = segment. rect
6567
66- // UIView.animateWithDuration(0.10, animations: {
67- // self.frame = self.segment.rect
68- // })
68+ frame = segment. rect
6969
7070 setNeedsDisplay ( )
7171 }
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ class GameBrain {
186186 moveHead ( )
187187
188188 if food. rect. contains ( headPoint) {
189-
189+
190190 score = score + 1
191191
192192 delegate? . updateScoreWithScore ( score)
You can’t perform that action at this time.
0 commit comments