Skip to content

Commit cce4fdb

Browse files
committed
create new array to fix HTML5 error throws
1 parent 6ce59d5 commit cce4fdb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Features/Save/source/PlayState.hx

+4-2
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@ class PlayState extends FlxState
157157
// You can also do something like gameSave.data.randomBool = true;
158158
// and if randomBool didn't exist before, then flash will create a boolean there.
159159
// though it's best to make a new type() before setting it, so you know the correct type is kept
160-
_gameSave.data.boxPositions = new Array();
160+
var boxPositions = new Array();
161161

162162
for (box in _boxGroup)
163163
{
164-
_gameSave.data.boxPositions.push(FlxPoint.get(box.x, box.y));
164+
boxPositions.push(FlxPoint.get(box.x, box.y));
165165
}
166166

167+
_gameSave.data.boxPositions = boxPositions;
168+
167169
_topText.text = "Created a new save, and saved positions";
168170
_topText.alpha = 1;
169171
}

0 commit comments

Comments
 (0)