Commit 12d71773 authored by wildfirecode's avatar wildfirecode

1

parent 6613eb2e
No preview for this file type
......@@ -28,7 +28,7 @@
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|7eb83e28-16db-43c5-a6a5-3e7e2abca5b7"
"texture": "res|82c35ef6-869e-4f5e-8f0b-36c899ed6b39"
}
}
],
......
This diff is collapsed.
......@@ -17,7 +17,19 @@ export const getTween = (context, val: Transform | Entity | ScillaComponent, obj
delete obj[key];
}
}
const scaleObj = {};
for (const key in obj) {
if (key == 'scalex') {
scaleObj['x'] = obj[key];
delete obj[key];
}
if (key == 'scaley') {
scaleObj['y'] = obj[key];
delete obj[key];
}
}
createTween(context, target.position, true).to(postionObj, duration, ease);
createTween(context, target.scale, true).to(scaleObj, duration, ease);
createTween(context, target, true).to(obj, duration, ease).call(r);
});
}
\ No newline at end of file
......@@ -9,8 +9,8 @@ import { VirtualNavigator } from "./VirtualNavigator";
import SceneStart from "../scenes/SceneStart";
import ScenePlay from "../scenes/ScenePlay";
import SceneGuide from "../scenes/SceneGuide";
import SceneCountdown from "../scenes/SceneCountdown";
import SceneResult from "../scenes/SceneResult";
import { Button } from "scilla-components/src";
export default class SingleSceneNavigator extends ScillaComponent {
_navigator: VirtualNavigator;
......@@ -21,7 +21,6 @@ export default class SingleSceneNavigator extends ScillaComponent {
this._navigator.register('start', 'SceneStart', SceneStart);
this._navigator.register('play', 'ScenePlay', ScenePlay);
this._navigator.register('guide', 'SceneGuide', SceneGuide);
this._navigator.register('countdown', 'SceneCountdown', SceneCountdown);
this._navigator.register('result', 'SceneResult', SceneResult);
}
......
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
export default class SceneCountdown extends ScillaComponent implements INavigatorViewBase {
onAwake() {
super.onAwake();
setTimeout(() => {
this.bubbling('fuck', 'play');
}, 1000);
}
// _timer
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = false;
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
{"ver":"1.0.1","uuid":"bfde8457-9b03-42f8-b7b2-d537e5481227","subMetas":{},"type":"script"}
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Button, InteractComponent } from "scilla-components/src";
export default class SceneGuide extends ScillaComponent implements INavigatorViewBase {
export default class SceneGuide extends InteractComponent implements INavigatorViewBase {
onAwake() {
super.onAwake();
setTimeout(() => {
this.bubbling('fuck', 'countdown');
}, 1000);
}
onGlobalTouchBegin(e) {
super.onGlobalTouchBegin(e);
this.onNextScene();
return false;
}
onNextScene() {
this.bubbling('fuck', 'play');
}
// _timer
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
......
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { Entity } from "scilla/src";
import { setText } from "../entityUtils";
import { getTween } from "../getTween";
import { setScale } from "../transformUtils";
import { Transform } from "scilla-components/src";
export default class ScenePlay extends ScillaComponent implements INavigatorViewBase {
countTxt: Entity;
num1: Entity;
num2: Entity;
num3: Entity;
box1: Entity;
box2: Entity;
box3: Entity;
private COUNT_DOWN_SEC = 16;
private _startTag = false;
private _msPassed = 0;
private _ballCounter = 0;
onAwake() {
super.onAwake();
this.initText();
this.playCountdown();
let addCounter = 0;
const add = () => {
addCounter++;
......@@ -43,10 +62,80 @@ export default class ScenePlay extends ScillaComponent implements INavigatorView
last_y = y;
last_z = z;
}
this._startTag = false;
}
addBall() {
async wait(ms) {
return new Promise((r) => {
setTimeout(r, ms);
})
}
async playCountdown() {
setScale(this.num1, 3);
setScale(this.num2, 3);
setScale(this.num3, 3);
this.num1.enabled = false;
this.num2.enabled = false;
this.num3.enabled = true;
await getTween(this, this.num3, { scalex: 1, scaley: 1 }, 300);
await this.wait(600);
this.num3.enabled = false;
this.num2.enabled = true;
await getTween(this, this.num2, { scalex: 1, scaley: 1 }, 300);
await this.wait(600);
this.num2.enabled = false;
this.num1.enabled = true;
await getTween(this, this.num1, { scalex: 1, scaley: 1 }, 300);
await this.wait(600);
this.startCountdown();
}
startCountdown() {
this._startTag = true;
this._msPassed = 0;
this._lastTimer = Date.now();
this._ballCounter = 0;
}
private _lastTimer: number;
onUpdate() {
if (!this._startTag) return;
this._msPassed += (Date.now() - this._lastTimer);
const left = this.COUNT_DOWN_SEC * 1000 - this._msPassed;
console.log(left)
const mPassed = Math.floor(left / 1000);
let msPassed = left % 1000;
msPassed = Math.floor(msPassed / 10);
this.updateText(mPassed, msPassed);
this._lastTimer = Date.now();
if (left <= 0) {
this.updateText(0, 0);
this._startTag = false;
this.onTimerout();
}
}
onTimerout() {
console.log('onTimerout')
}
getNumber(num) {
if (num < 10)
return `0${num}`
return `${num}`
}
updateText(a, b) {
setText(this.countTxt, `${this.getNumber(a)}.${this.getNumber(b)}s`)
}
initText() {
setText(this.countTxt, `${this.getNumber(this.COUNT_DOWN_SEC)}.00s`)
}
addBall() {
this._ballCounter++;
}
onGameOver() {
......
......@@ -2,13 +2,11 @@
* Created by rockyl on 2019-04-09.
*/
import { Button } from "scilla-components/src";
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, AssetsManager } from "scilla/src";
import { setText } from "../entityUtils";
import { dynamic, Entity } from "scilla/src";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import { getRotation, setRotation } from "../transformUtils";
import { Button, TouchInterrupt } from "scilla-components/src";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
......
{"ver":"1.0.1","uuid":"1f737398-ebbb-4a65-9851-0303fd5def02","subMetas":{"1.png":{"ver":"1.0.1","uuid":"4f3816da-553e-40e1-8568-cc1bf669783d","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"2.png":{"ver":"1.0.1","uuid":"ae3c021b-fbbf-43d3-ad6d-dc4b7bf2a7c9","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"3.png":{"ver":"1.0.1","uuid":"207eb774-d33a-4309-b420-667bea6c6cf6","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"red1.png":{"ver":"1.0.1","uuid":"82c35ef6-869e-4f5e-8f0b-36c899ed6b39","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"red3.png":{"ver":"1.0.1","uuid":"f6bd28a5-3821-42a0-a1bd-4c56b7809297","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"red4.png":{"ver":"1.0.1","uuid":"54890950-7189-4449-ae8c-af215515c599","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"red5.png":{"ver":"1.0.1","uuid":"3711c0c3-d305-4664-b67e-2de454ceb71d","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"yellow1.png":{"ver":"1.0.1","uuid":"55566266-19f2-4377-ab9a-d69fcaf0d381","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"yellow2.png":{"ver":"1.0.1","uuid":"4fcabe5c-1f52-4a1c-ae26-d1a66c5ecc34","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"盒子.png":{"ver":"1.0.1","uuid":"56bcd2e4-f0a1-4228-a528-c95f18b1092b","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"盒子2.png":{"ver":"1.0.1","uuid":"1740da0d-b247-46bd-a062-39940b88d549","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"盒子3.png":{"ver":"1.0.1","uuid":"710ca0e4-99bc-4b77-800a-f2d71b9cb69f","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"},"装饰.png":{"ver":"1.0.1","uuid":"f4ea00e4-af9e-4761-876f-eb1c5101b4f2","rawTextureUuid":"1f737398-ebbb-4a65-9851-0303fd5def02","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","subMetas":{"rulebtn.png":{"ver":"1.0.1","uuid":"d092293f-6a84-45eb-a7c2-7735b747c2af","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"8分.png":{"ver":"1.0.1","uuid":"2b8c13b0-c675-4031-ac51-8d39afb41505","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"recordbtn.png":{"ver":"1.0.1","uuid":"7c2aa27c-5cf6-46d0-8509-d9b68052de09","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"roles.png":{"ver":"1.0.1","uuid":"5c3bc8ff-d886-437f-8320-cfef9bdc71e6","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"startbtn.png":{"ver":"1.0.1","uuid":"65d0864b-a3b8-438b-aa87-673311473c7f","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"text1.png":{"ver":"1.0.1","uuid":"ce594e8b-00d9-4171-a4e1-3d77fd6746f6","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"兑吧大牌券.png":{"ver":"1.0.1","uuid":"41a91467-d5fa-461d-b2dc-a842c786b76a","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"口红.png":{"ver":"1.0.1","uuid":"9c55b44d-3454-438d-b5fd-d73fea0a291c","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"栅栏.png":{"ver":"1.0.1","uuid":"13befe8b-8a33-46e2-bee6-fa0d17994329","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"树.png":{"ver":"1.0.1","uuid":"e4e0b901-f0ef-4c1c-a90e-bc923dd8c4e7","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"炸弹.png":{"ver":"1.0.1","uuid":"9c6e40d8-0c90-41fe-ad28-9064ca7103ee","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"礼盒.png":{"ver":"1.0.1","uuid":"e6ca4128-75b8-4b8b-8a7d-8f95d46f810f","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"组 81.png":{"ver":"1.0.1","uuid":"7e76fac1-7791-476b-b73f-7cd5b4ea1344","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"ball1.png":{"ver":"1.0.1","uuid":"7eb83e28-16db-43c5-a6a5-3e7e2abca5b7","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"ball2.png":{"ver":"1.0.1","uuid":"9d796938-f7de-45b1-8135-101a48277c1a","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"ball3.png":{"ver":"1.0.1","uuid":"7c42d0d1-b40e-4df5-8698-30ccf3c2f8bc","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"rankbtn.png":{"ver":"1.0.1","uuid":"66066ff4-4536-4398-84ad-8cf91c2d8333","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","subMetas":{"rulebtn.png":{"ver":"1.0.1","uuid":"d092293f-6a84-45eb-a7c2-7735b747c2af","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"recordbtn.png":{"ver":"1.0.1","uuid":"7c2aa27c-5cf6-46d0-8509-d9b68052de09","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"startbtn.png":{"ver":"1.0.1","uuid":"65d0864b-a3b8-438b-aa87-673311473c7f","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"},"rankbtn.png":{"ver":"1.0.1","uuid":"66066ff4-4536-4398-84ad-8cf91c2d8333","rawTextureUuid":"ed0e6061-7014-492f-b95f-88794de7d5cc","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"3a78d5ce-8939-4fb9-8aad-23e5f8a179b4","subMetas":{"playbg":{"ver":"1.0.1","uuid":"bf3dc05b-5ca3-4db9-a246-e6e0913ee177","rawTextureUuid":"3a78d5ce-8939-4fb9-8aad-23e5f8a179b4","type":"texture"}},"type":"texture","imagePath":"/Users/wanghongyuan/shuijf2/assets/singles/playbg.jpg"}
{"ver":"1.0.1","uuid":"34886980-b89a-4308-8d6c-dec61af0b2f9","subMetas":{"游戏引导":{"ver":"1.0.1","uuid":"e3e14560-8c84-4432-a264-d63638d0a38b","rawTextureUuid":"34886980-b89a-4308-8d6c-dec61af0b2f9","type":"texture"}},"type":"texture","imagePath":"/Users/wanghongyuan/shuijf2/assets/singles/游戏引导.png"}
This diff is collapsed.
This diff is collapsed.
......@@ -5,23 +5,23 @@
import {registerDef} from 'scilla'
import component0 from 'components/other/CameraController';
registerDef('components/other/CameraController', component0);
import component0 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component0);
import component1 from 'components/base/Transform';
registerDef('components/base/Transform', component1);
import component2 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component2);
import component2 from 'components/renderer/HtmlRenderer';
registerDef('components/renderer/HtmlRenderer', component2);
import component3 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component3);
import component3 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component3);
import component4 from 'components/ui/Button';
registerDef('components/ui/Button', component4);
import component4 from 'components/ui/ScrollView';
registerDef('components/ui/ScrollView', component4);
import component5 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component5);
import component5 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component5);
import component6 from 'components/other/FullStageSize';
registerDef('components/other/FullStageSize', component6);
......@@ -29,62 +29,59 @@ registerDef('components/other/FullStageSize', component6);
import component7 from 'components/base/TouchInterrupt';
registerDef('components/base/TouchInterrupt', component7);
import component8 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component8);
import component8 from 'components/other/CameraController';
registerDef('components/other/CameraController', component8);
import component9 from 'components/ui/ScrollView';
registerDef('components/ui/ScrollView', component9);
import component9 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component9);
import component10 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component10);
import component10 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component10);
import component11 from 'components/renderer/HtmlRenderer';
registerDef('components/renderer/HtmlRenderer', component11);
import component11 from 'components/ui/Button';
registerDef('components/ui/Button', component11);
import component12 from '../../assets/scripts/scenes/ScenePlay';
registerDef('./scripts/scenes/ScenePlay', component12);
import component12 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component12);
import component13 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component13);
import component13 from '../../assets/scripts/scenes/ScenePlay';
registerDef('./scripts/scenes/ScenePlay', component13);
import component14 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component14);
import component14 from '../../assets/scripts/scenes/SceneGuide';
registerDef('./scripts/scenes/SceneGuide', component14);
import component15 from '../../assets/scripts/scenes/SceneCountdown';
registerDef('./scripts/scenes/SceneCountdown', component15);
import component15 from '../../assets/scripts/scenes/SceneResult';
registerDef('./scripts/scenes/SceneResult', component15);
import component16 from '../../assets/scripts/scenes/SceneResult';
registerDef('./scripts/scenes/SceneResult', component16);
import component16 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component16);
import component17 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component17);
import component17 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component17);
import component18 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component18);
import component18 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component18);
import component19 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component19);
import component20 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component20);
import component20 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component20);
import component21 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component21);
import component21 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component21);
import component22 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component22);
import component22 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component22);
import component23 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component23);
import component23 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component23);
import component24 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component24);
import component24 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component24);
import component25 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component25);
import component25 from '../../assets/scripts/dialogs/PrizeDialogContent';
registerDef('./scripts/dialogs/PrizeDialogContent', component25);
import component26 from '../../assets/scripts/dialogs/PrizeDialogContent';
registerDef('./scripts/dialogs/PrizeDialogContent', component26);
import component27 from '../../assets/scripts/scenes/SceneGuide';
registerDef('./scripts/scenes/SceneGuide', component27);
import component26 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component26);
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