Commit a317d322 authored by wildfirecode's avatar wildfirecode

1

parent 201616ad
......@@ -44,9 +44,9 @@
<script src="libs/downloadApp.js"></script>
<!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjs/5.4.0/math.js'></script> -->
<script>
localStorage.clear();
localStorage.setItem('currentLv','Gift2');
localStorage.setItem('data',JSON.stringify({"IceCream":3,"Donut":3,"Egg":3,"Candy2":3,"Gift2":2}))
// localStorage.clear();
// localStorage.setItem('currentLv','Gift2');
// localStorage.setItem('data',JSON.stringify({"IceCream":3,"Donut":3,"Egg":3,"Candy2":3,"Gift2":2}))
window['development'] = true;
var gameId = 1;
var CFG = {
......
......@@ -11,9 +11,6 @@ const restitution = 0.7;
// const types = [LabelType.Candy2,LabelType.Donut,LabelType.Egg];
const types = [LabelType.Boom, LabelType.IceCream, LabelType.Donut, LabelType.Candy2, LabelType.Gift2, LabelType.Egg];
let frameInterval = 10;
let tags = 0;
if (localStorage.getItem('guilde1') == '1') tags = 1;
if (localStorage.getItem('guilde2') == '1') tags = 2;
let pastFrame = 0;
let _this;
......@@ -22,12 +19,21 @@ const ontick = () => {
pastFrame++;
return
};
let tags = 0;
let dir;
if (localStorage.getItem('guilde1') == '1') tags = 1;
if (localStorage.getItem('guilde2') == '1') tags = 2;
if (pastFrame >= frameInterval) pastFrame = 0;
let i = Math.floor(Math.random() * types.length);
if (tags == 0) { i = 1; tags = 1; frameInterval = 180; }
else if (tags == 1) { i = 0; tags = 2; }
if (tags == 0) {
i = 1; dir = 'left'; frameInterval = 180;
}
else if (tags == 1) {
i = 0; dir = 'right'
}
else if (tags == 2) {
frameInterval = 60;
dir = null;
}
// i=4;
const type = types[i];
......@@ -36,7 +42,9 @@ const ontick = () => {
const forceScale = 15;
const leftStart = { x: startX, y: startY, forceX: 0.01 * forceScale };
const rightStart = { x: 750 - startX, y: startY, forceX: -0.01 * forceScale };
const start = Math.random() > 0.5 ? leftStart : rightStart;
const isleft = Math.random() > 0.5;
console.log('isleft', isleft)
const start = isleft ? leftStart : rightStart;
const scale = 2;
const baseItem = createItem(scale, type);
body = _this._egretRender.rectangle(start.x, start.y, 49 * scale, 18 * scale, baseItem,
......@@ -55,9 +63,9 @@ const ontick = () => {
const leftStart = { x: startX, y: startY, forceX: 0.01 * forceScale };
const rightStart = { x: 750 - startX, y: startY, forceX: -0.01 * forceScale };
let start = Math.random() > 0.5 ? leftStart : rightStart;
if (tags == 1) {
if (dir == 'left') {
start = leftStart;
} else if (tags == 2) {
} else if (dir == 'right') {
start = rightStart;
}
const size = 49 * 1.15;
......@@ -80,7 +88,7 @@ const ontick = () => {
export default ($this: StartScene) => {
_this = $this;
if(isAllLevelPass())return;
if (isAllLevelPass()) return;
egret.startTick(ontick, this)
}
......
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