Commit dcfce110 authored by wildfirecode's avatar wildfirecode

1

parent b1d175e4
import ScillaComponent from 'components/base/ScillaComponent'; import ScillaComponent from 'components/base/ScillaComponent';
import { Entity } from 'scilla/src'; import { setY, getY } from '../transformUtils';
import { setXY } from '../transformUtils';
export default class Drop extends ScillaComponent { export default class Drop extends ScillaComponent {
private G = .7;
private _v = 0;
onAwake() { onAwake() {
super.onAwake(); super.onAwake();
console.log('fuckon awake')
this.reset(); this.reset();
} }
callback;
reset() { reset() {
// const { children } = this.entity; const { children } = this.entity;
// const index = Math.floor(Math.random() * children.length); const index = Math.floor(Math.random() * children.length);
// const drop=children[index]; const drop = children[index];
// children.forEach((v, i) => { children.forEach((v, i) => {
// v.enabled = index == i; v.enabled = index == i;
// }); });
// // setXY(drop,) this._v = 3;
setY(this.entity, -400);
} }
onUpdate(t) { onUpdate(t) {
super.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 ...@@ -29,31 +29,19 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
super.onAwake(); super.onAwake();
if (!this._drop) { if (!this._drop) {
this._drop = instantiate(this.Drop).getComponent(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); this.entity.addChild(this._drop.entity);
} }
} }
// private setCountText(text: string) { dropEndCallback = () => {
// setText(this.countTxt, text); this.onShakeOver();
// } }
initGameStage() { 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() { onClick_startbtn() {
this.startbtn.getComponent(Button).enabled = false; this.startbtn.getComponent(Button).enabled = false;
this._shakeTimes = this.SHAK_TIMERS; this._shakeTimes = this.SHAK_TIMERS;
...@@ -95,7 +83,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -95,7 +83,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
setRotation(this.treeWrapper, -getRotation(this.treeWrapper)) setRotation(this.treeWrapper, -getRotation(this.treeWrapper))
if (this._shakeTimes <= 0) { if (this._shakeTimes <= 0) {
setRotation(this.treeWrapper, 0); setRotation(this.treeWrapper, 0);
this.onShakeOver(); this._drop.entity.enabled = true;
} }
this._counter = this.FREQ; this._counter = this.FREQ;
} else { } 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
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* THIS FILE WAS GENERATE BY COMPILER * THIS FILE WAS GENERATE BY COMPILER
* DO NOT MODIFY THIS FILE * DO NOT MODIFY THIS FILE
*/ */
import { registerDef } from 'scilla' import {registerDef} from 'scilla'
import component0 from 'components/other/RelativeLayout'; import component0 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component0); 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