Commit dcfce110 authored by wildfirecode's avatar wildfirecode

1

parent b1d175e4
import ScillaComponent from 'components/base/ScillaComponent';
import { Entity } from 'scilla/src';
import { setXY } from '../transformUtils';
import { setY, getY } from '../transformUtils';
export default class Drop extends ScillaComponent {
private G = .7;
private _v = 0;
onAwake() {
super.onAwake();
console.log('fuckon awake')
this.reset();
}
callback;
reset() {
// const { children } = this.entity;
// const index = Math.floor(Math.random() * children.length);
// const drop=children[index];
// children.forEach((v, i) => {
// v.enabled = index == i;
// });
// // setXY(drop,)
const { children } = this.entity;
const index = Math.floor(Math.random() * children.length);
const drop = children[index];
children.forEach((v, i) => {
v.enabled = index == i;
});
this._v = 3;
setY(this.entity, -400);
}
onUpdate(t) {
super.onUpdate(t);
this._v += this.G;
setY(this.entity, getY(this.entity) + this._v);
if (getY(this.entity) > 100) {
this.callback();
this.entity.enabled = false;
}
}
}
......@@ -29,31 +29,19 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
super.onAwake();
if (!this._drop) {
this._drop = instantiate(this.Drop).getComponent(Drop);
// this._drop.entity.enabled = false;
this._drop.entity.enabled = false;
this._drop.callback = this.dropEndCallback;
this.entity.addChild(this._drop.entity);
}
}
// private setCountText(text: string) {
// setText(this.countTxt, text);
// }
dropEndCallback = () => {
this.onShakeOver();
}
initGameStage() {
// // this.updateCountText();
// this.bubbling('showToast', '活动还未开始\n敬请期待')
}
// updateCountText() {
// const { element } = this.ajaxElement;
// let text = ''
// if (element.freeLimit > 0) {
// text = `今日剩余免费次数:${element.freeLimit}次`;
// } else {
// text = `${element.needCredits}${window['CFG'].unitName}/次`
// }
// this.setCountText(text);
// }
onClick_startbtn() {
this.startbtn.getComponent(Button).enabled = false;
this._shakeTimes = this.SHAK_TIMERS;
......@@ -95,7 +83,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
setRotation(this.treeWrapper, -getRotation(this.treeWrapper))
if (this._shakeTimes <= 0) {
setRotation(this.treeWrapper, 0);
this.onShakeOver();
this._drop.entity.enabled = true;
}
this._counter = this.FREQ;
} else {
......
assets/singles/bg.jpg

51 KB | W: | H:

assets/singles/bg.jpg

111 KB | W: | H:

assets/singles/bg.jpg
assets/singles/bg.jpg
assets/singles/bg.jpg
assets/singles/bg.jpg
  • 2-up
  • Swipe
  • Onion skin
assets/singles/cankao.jpg

161 KB | W: | H:

assets/singles/cankao.jpg

127 KB | W: | H:

assets/singles/cankao.jpg
assets/singles/cankao.jpg
assets/singles/cankao.jpg
assets/singles/cankao.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,7 +3,7 @@
* DO NOT MODIFY THIS FILE
*/
import { registerDef } from 'scilla'
import {registerDef} from 'scilla'
import component0 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component0);
......
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