bugfixing from frc demo

This commit is contained in:
2022-08-29 15:51:53 +00:00
parent 45aaa96c1d
commit b456e2d2fd
2 changed files with 27 additions and 21 deletions

View File

@@ -244,7 +244,7 @@
(set puzzleUnlocked nextStartingPoints)) (set puzzleUnlocked nextStartingPoints))
(break))))) (break)))))
((and m.rewardFiles .skipped (last m.rewardFiles)) ((and m.rewardFiles .skipped (last m.rewardFiles))
(set puzzleUnlocked (- p 1))) (set puzzleUnlocked (max 0 (- p 1))))
(true (true
(set puzzleUnlocked 0)))) (set puzzleUnlocked 0))))
@@ -561,7 +561,8 @@
(method _makeText [:String s :Int points &opt :Action action] (method _makeText [:String s :Int points &opt :Action action]
(entryWindow.makeText (+ s (pointsStr points)) action)) (entryWindow.makeText (+ s (pointsStr points)) action))
(method log [:String message] (method :Void log [:String message]
(when (> message.length 100) (log (message.substr 0 100)) (return))
(trace message) (trace message)
(prop &mut logTextY 0) (prop &mut logTextY 0)
(#when debug (#when debug
@@ -576,9 +577,12 @@
(logTexts.add text)))) (logTexts.add text))))
(method :FlxRect matchZone [:KissExtendedSprite s compass] (method :FlxRect matchZone [:KissExtendedSprite s compass]
(let [bubblePoints (dictGet .bubblePoints (dictGet pieceData (dictGet indexMap s)) compass)] (assertLet [id (dictGet indexMap s)
jig (dictGet pieceData id)]
(let [bubblePoints (dictGet jig.bubblePoints compass)]
(unless bubblePoints (unless bubblePoints
(return (new FlxRect 0 0 0 0))) (return (new FlxRect 0 0 0 0)))
(printLocalNulls)
(let [ros (roughOptimalScale) (let [ros (roughOptimalScale)
pointsX (for point bubblePoints point.x) pointsX (for point bubblePoints point.x)
pointsY (for point bubblePoints point.y) pointsY (for point bubblePoints point.y)
@@ -594,7 +598,7 @@
rotated (rect.getRotatedBounds s.angle originOffset)] rotated (rect.getRotatedBounds s.angle originOffset)]
(+= rotated.x s.x) (+= rotated.x s.x)
(+= rotated.y s.y) (+= rotated.y s.y)
rotated))) rotated))))
(method :FlxRect matchZoneLeft [:KissExtendedSprite s] (method :FlxRect matchZoneLeft [:KissExtendedSprite s]
(matchZone s WEST)) (matchZone s WEST))

View File

@@ -20,6 +20,8 @@ class Main extends Sprite
var habitFile = Prelude.joinPath(saveFolder, "habits.txt"); var habitFile = Prelude.joinPath(saveFolder, "habits.txt");
if (!(FileSystem.exists(saveFolder) && FileSystem.isDirectory(saveFolder))) { if (!(FileSystem.exists(saveFolder) && FileSystem.isDirectory(saveFolder))) {
FileSystem.createDirectory(saveFolder); FileSystem.createDirectory(saveFolder);
}
if (!FileSystem.exists(habitFile)) {
File.saveContent(habitFile, File.getContent("assets/default.txt")); File.saveContent(habitFile, File.getContent("assets/default.txt"));
} }