Commit 16762efd authored by wildfirecode's avatar wildfirecode

1

parent be9d5e11
...@@ -33,16 +33,15 @@ export default (_this: StartScene) => { ...@@ -33,16 +33,15 @@ export default (_this: StartScene) => {
const items = getCurrentItems();//[[LabelType.boom, 1], [LabelType.coin, 5]] const items = getCurrentItems();//[[LabelType.boom, 1], [LabelType.coin, 5]]
const list = []; const list = [];
for (const item of items) { for (const item of items) {
for (let i = 0; i < item[1]; i++) {
list.push(item[0]);
}
} }
let count = 0; let count = 0;
const countMax = 1; const countMax = 1;
const coinsFall = setInterval(() => { const coinsFall = setInterval(() => {
if (count < 14) { if (count <= list.length - 1) {
// const types = [ LabelType.candy, LabelType.coin, LabelType.gift,LabelType.egg] const type = list[count];
const types = [LabelType.boom, LabelType.candy, LabelType.coin, LabelType.gift, LabelType.egg]
const i = Math.floor(Math.random() * types.length);
const type = types[i];
createBubble(_this, type, 375 + Math.random() * 200 - 100, 400 + 200 + 100) createBubble(_this, type, 375 + Math.random() * 200 - 100, 400 + 200 + 100)
count++; count++;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment