put it all together
This commit is contained in:
@@ -171,9 +171,15 @@
|
|||||||
->:Void [s x y]
|
->:Void [s x y]
|
||||||
{
|
{
|
||||||
(set draggingSprite null)
|
(set draggingSprite null)
|
||||||
|
|
||||||
(checkMatches i)
|
(checkMatches i)
|
||||||
(pieceCamera.calculateScrollBounds rewardSprites SCROLL_BOUND_MARGIN)
|
|
||||||
(dictSet (the Map<Int,FlxPoint> save.data.storedPositions) i (new FlxPoint s.x s.y))
|
(dictSet (the Map<Int,FlxPoint> save.data.storedPositions) i (new FlxPoint s.x s.y))
|
||||||
|
(doFor connected (recursivelyConnectedPieces s)
|
||||||
|
(checkMatches (dictGet indexMap connected))
|
||||||
|
(dictSet (the Map<Int,FlxPoint> save.data.storedPositions) (dictGet indexMap connected) (new FlxPoint connected.x connected.y)))
|
||||||
|
|
||||||
|
|
||||||
|
(pieceCamera.calculateScrollBounds rewardSprites SCROLL_BOUND_MARGIN)
|
||||||
(save.flush)
|
(save.flush)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -203,24 +209,26 @@
|
|||||||
(dictSet matchingPiecesDown id toDown)) (catch [e] null)))))
|
(dictSet matchingPiecesDown id toDown)) (catch [e] null)))))
|
||||||
(add rewardSprites)
|
(add rewardSprites)
|
||||||
(doFor i (range TOTAL_PIECES)
|
(doFor i (range TOTAL_PIECES)
|
||||||
(checkMatches i)))))
|
(checkMatches i))))
|
||||||
|
|
||||||
(pieceCamera.calculateScrollBounds rewardSprites SCROLL_BOUND_MARGIN)
|
(pieceCamera.calculateScrollBounds rewardSprites SCROLL_BOUND_MARGIN)
|
||||||
|
|
||||||
(when entryTexts (remove entryTexts))
|
(when entryTexts (remove entryTexts))
|
||||||
(set entryTexts (new FlxTypedGroup))
|
(set entryTexts (new FlxTypedGroup))
|
||||||
(set textY 0)
|
(set textY 0)
|
||||||
(set color FlxColor.ORANGE)
|
(set color FlxColor.LIME)
|
||||||
(map (m.activeDailyEntries) makeText)
|
(_makeText "Puzzle #$(+ 1 rewardFileIndex) / ${model.rewardFiles.length}" (- TOTAL_PIECES (- p currentRewardFile.startingPoints)))
|
||||||
(set color FlxColor.GREEN)
|
(set color FlxColor.ORANGE)
|
||||||
(map (m.activeMonthlyEntries) makeText)
|
(map (m.activeDailyEntries) makeText)
|
||||||
(set color FlxColor.BLUE)
|
(set color FlxColor.GREEN)
|
||||||
(map (m.activeIntervalEntries) makeText)
|
(map (m.activeMonthlyEntries) makeText)
|
||||||
(set color FlxColor.WHITE)
|
(set color FlxColor.BLUE)
|
||||||
(map (m.activeBonusEntries) makeText)
|
(map (m.activeIntervalEntries) makeText)
|
||||||
(set color FlxColor.YELLOW)
|
(set color FlxColor.WHITE)
|
||||||
(map (m.activeTodoEntries) makeText)
|
(map (m.activeBonusEntries) makeText)
|
||||||
(add entryTexts)
|
(set color FlxColor.YELLOW)
|
||||||
|
(map (m.activeTodoEntries) makeText)
|
||||||
|
(add entryTexts))
|
||||||
|
|
||||||
(doFor e (m.allEntries)
|
(doFor e (m.allEntries)
|
||||||
(when (HabitModel.isActive e)
|
(when (HabitModel.isActive e)
|
||||||
@@ -246,8 +254,11 @@
|
|||||||
(prop &mut :FlxColor color FlxColor.BLACK)
|
(prop &mut :FlxColor color FlxColor.BLACK)
|
||||||
|
|
||||||
(method makeText [:Entry e]
|
(method makeText [:Entry e]
|
||||||
(let [label (HabitModel.activeLabel e)
|
(let [label (HabitModel.activeLabel e)]
|
||||||
text (new FlxText 0 textY 0 (+ label.label (* label.points "+")) 16)]
|
(_makeText label.label label.points)))
|
||||||
|
|
||||||
|
(method _makeText [:String s :Int points]
|
||||||
|
(let [text (new FlxText 0 textY 0 (+ s (* points "+")) 16)]
|
||||||
(set text.color color)
|
(set text.color color)
|
||||||
(set text.cameras [uiCamera])
|
(set text.cameras [uiCamera])
|
||||||
(+= textY text.height)
|
(+= textY text.height)
|
||||||
@@ -266,7 +277,6 @@
|
|||||||
(method :Void connectPiece [id self toSprite]
|
(method :Void connectPiece [id self toSprite]
|
||||||
(let [thisConnectedPieces (dictGet connectedPieces id)
|
(let [thisConnectedPieces (dictGet connectedPieces id)
|
||||||
toConnectedPieces (dictGet connectedPieces (dictGet indexMap toSprite))]
|
toConnectedPieces (dictGet connectedPieces (dictGet indexMap toSprite))]
|
||||||
(print "connection $c found")
|
|
||||||
(+= c 1)
|
(+= c 1)
|
||||||
// Don't add duplicates
|
// Don't add duplicates
|
||||||
(thisConnectedPieces.remove toSprite)
|
(thisConnectedPieces.remove toSprite)
|
||||||
|
Reference in New Issue
Block a user