Commit adbb899c authored by wildfirecode's avatar wildfirecode

1

parent 706088d6
No preview for this file type
This diff is collapsed.
......@@ -5,17 +5,16 @@
*/
import DialogContent from "../popup/DialogContent";
import { Entity } from "scilla/src";
import { setText } from "../entityUtils";
export default class AlertDialogContent extends DialogContent {
content: Entity;
onAwake() {
super.onAwake();
}
setup(data: any = {}) {
}
onClickConfirmButton() {
this.hide('confirm')
setText(this.content, data);
}
}
......@@ -28,7 +28,7 @@ export default class Popup extends ScillaComponent {
this._touchInterrupt = this.getComponent(TouchInterrupt);
this._touchInterrupt.enabled = false;
this.bgRenderer.enabled = false;
// this.bgRenderer.enabled = false;
this._navigator = this.sceneContainer.getComponent(SingleSceneNavigator);
......
......@@ -3,27 +3,35 @@
*/
import ScillaComponent from "scilla-components/src/base/ScillaComponent";
import { dynamic, Entity, ScillaEngine } from "scilla/src";
import { dynamic, Entity } from "scilla/src";
import { setText } from "../entityUtils";
import { alien } from "../navigator/StackNavigator";
import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import ScillaLauncher from "scilla-launcher/src";
import { getRotation, setRotation } from "../transformUtils";
import { Button } from "scilla-components/src";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
ajaxElement: dynamic;
doJoin: dynamic;
// getNgameStartStatus: dynamic;
getNgameStartStatus: dynamic;
countTxt: Entity;
startbtn: Entity;
rankbtn: Entity;
rulebtn: Entity;
treeWrapper: Entity;
private _gifts: Entity[];
onAwake() {
super.onAwake();
// this.setCountText('');
// SingleSceneNavigator
console.log('fuck start scene')
this._gifts = this.treeWrapper.getChildrenByName('gift');
// setTimeout(() => {
// this.bubbling('showDialog', 'Alert','fuck');
// }, 1000);
}
private setCountText(text: string) {
......@@ -47,29 +55,58 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onClick_startbtn() {
this.startbtn.getComponent(Button).enabled = false;
this._shakeTimes = this.SHAK_TIMERS;
this._counter = 0;
setRotation(this.treeWrapper, this.STREN);
}
onShakeOver() {
this.broadcast('callApi', 1, 'doJoin', {
activityId: window['CFG'].actId,
activityType: 'hdtool',
consumerId: window['CFG'].consumerId
});
// globalEvent.emit('popup', { name: 'RulePanel', params: {} }, this.onAlertClose);
}
private STREN = 5;
private FREQ = 3;
private SHAK_TIMERS = 10;
private _shakeTimes = -1;
private _counter = -1;
onUpdate() {
if (this._shakeTimes <= 0) return;
if (this._counter <= 0) {
this._shakeTimes--;
setRotation(this.treeWrapper, -getRotation(this.treeWrapper))
if (this._shakeTimes <= 0) {
setRotation(this.treeWrapper, 0);
this.onShakeOver();
}
this._counter = this.FREQ;
} else {
this._counter--;
}
}
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
// this.startbtn.getComponent(Button).enabled = true;
this.broadcast('callApi', 1, 'getNgameStartStatus', {
orderId: this.doJoin
});
}
onGotDojoinError() {
console.log('onGotDojoinError')
onGotDojoinError(...argument) {
this.startbtn.getComponent(Button).enabled = true;
console.log('onGotDojoinError',argument);
}
onGot_getNgameStartStatus() {
// console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
//fuck 不可以循环引用
this.bubbling('fuck', 'play');
// this.bubbling('fuck', 'play');
}
onGotError_getNgameStartStatus() {
......@@ -86,6 +123,11 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onClick_recordbtn() {
alert('onClick_recordbtn')
// globalEvent.emit('alert', {title: 'Success', content: 'You complete this puzzle', button: 'Next level'}, this.onAlertClose);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
this.entity.enabled = true;
}
......
......@@ -5,6 +5,12 @@ import { Entity } from 'scilla/src';
export const setX = (entity: Entity, x) => {
entity.getComponent(Transform).position.x = x;
}
export const setRotation = (entity: Entity, x) => {
entity.getComponent(Transform).rotation=x;
}
export const getRotation = (entity: Entity) => {
return entity.getComponent(Transform).rotation
}
export const setAlpha = (val: Entity | ScillaComponent, alpha: number) => {
if (val instanceof Entity) {
......
assets/singles/alertbg.png

153 KB | W: | H:

assets/singles/alertbg.png

156 KB | W: | H:

assets/singles/alertbg.png
assets/singles/alertbg.png
assets/singles/alertbg.png
assets/singles/alertbg.png
  • 2-up
  • Swipe
  • Onion skin
{"ver":"1.0.1","uuid":"20070530-0eaf-4e77-af40-bee6392b5e52","subMetas":{"按钮":{"ver":"1.0.1","uuid":"0ef49c1b-4077-4285-840e-6639ef4c5f69","rawTextureUuid":"20070530-0eaf-4e77-af40-bee6392b5e52","type":"texture"}},"type":"texture","imagePath":"/Users/wanghongyuan/shuijf/assets/singles/按钮.png"}
File added
This diff is collapsed.
{
"file": "prize.png",
"frames": {
"prizebg.png": {
"x": 1,
"y": 1,
"w": 604,
"h": 871,
"offX": 0,
"offY": 0,
"sourceW": 604,
"sourceH": 871
},
"usebtn.png": {
"x": 1,
"y": 874,
"w": 333,
"h": 99,
"offX": 0,
"offY": 0,
"sourceW": 333,
"sourceH": 99
}
}
}
\ No newline at end of file
{
"file": "rule.png",
"frames": {
"游戏说明-1.png": {
"x": 1,
"y": 1,
"w": 549,
"h": 628,
"offX": 0,
"offY": 0,
"sourceW": 549,
"sourceH": 628
},
"closeBtn-1.png": {
"x": 1,
"y": 631,
"w": 56,
"h": 56,
"offX": 0,
"offY": 0,
"sourceW": 56,
"sourceH": 56
}
}
}
\ No newline at end of file
{
"file": "start.png",
"frames": {
"roles.png": {
"x": 1,
"y": 1,
"w": 665,
"h": 523,
"offX": 0,
"offY": 0,
"sourceW": 665,
"sourceH": 523
},
"startbtn.png": {
"x": 668,
"y": 1,
"w": 329,
"h": 111,
"offX": 0,
"offY": 0,
"sourceW": 329,
"sourceH": 111
},
"口红.png": {
"x": 999,
"y": 1,
"w": 62,
"h": 106,
"offX": 0,
"offY": 0,
"sourceW": 62,
"sourceH": 106
},
"栅栏.png": {
"x": 668,
"y": 114,
"w": 309,
"h": 111,
"offX": 0,
"offY": 0,
"sourceW": 309,
"sourceH": 111
},
"礼盒.png": {
"x": 668,
"y": 227,
"w": 173,
"h": 156,
"offX": 0,
"offY": 0,
"sourceW": 173,
"sourceH": 156
},
"兑吧大牌券.png": {
"x": 843,
"y": 227,
"w": 148,
"h": 145,
"offX": 0,
"offY": 0,
"sourceW": 148,
"sourceH": 145
},
"8分.png": {
"x": 843,
"y": 374,
"w": 138,
"h": 117,
"offX": 0,
"offY": 0,
"sourceW": 138,
"sourceH": 117
},
"recordbtn.png": {
"x": 668,
"y": 385,
"w": 135,
"h": 34,
"offX": 0,
"offY": 0,
"sourceW": 135,
"sourceH": 34
},
"rulebtn.png": {
"x": 668,
"y": 421,
"w": 134,
"h": 34,
"offX": 0,
"offY": 0,
"sourceW": 134,
"sourceH": 34
},
"炸弹.png": {
"x": 668,
"y": 457,
"w": 128,
"h": 162,
"offX": 0,
"offY": 0,
"sourceW": 128,
"sourceH": 162
},
"树.png": {
"x": 1,
"y": 526,
"w": 621,
"h": 814,
"offX": 0,
"offY": 0,
"sourceW": 621,
"sourceH": 814
},
"组 81.png": {
"x": 798,
"y": 493,
"w": 119,
"h": 198,
"offX": 0,
"offY": 0,
"sourceW": 119,
"sourceH": 198
},
"text1.png": {
"x": 1,
"y": 1342,
"w": 598,
"h": 191,
"offX": 0,
"offY": 0,
"sourceW": 598,
"sourceH": 191
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>shuijf</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<style>
html,
body,
p {
padding: 0;
margin: 0;
border: 0;
}
html,
body {
height: 100%;
background-color: #282C34;
}
#loading {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
#floatLayer::-webkit-scrollbar {
display: none
}
</style>
</head>
<body>
<div id="gameContainer" style="width: 100%;height: 100%;overflow: hidden;"></div>
<div id="loading">
<img src="loading.gif" />
</div>
<script src="./zepto.min.js"></script>
<script src="./security.js"></script>
<script src="bundle.js"></script>
<script>
var CFG = { "actId": "3335069", "oaId": "3335069", "unitName": "积分", "btnUnitName": "积分", "doJoin": "/hdtool/doJoin?dpm=1.3.1.0&activityId=3335069", "quireOrder": "/hdtool/getOrderStatus", "styleConfig": "/hdtool/getHdtoolConfig", "getElement": "/hdtool/ajaxElement", "getPrizeDetail": "/hdtool/prizeDetail", "ajaxThroughInfo": "/hdtool/ajaxThroughInfo", "throughSubmit": "/hdtool/throughSubmit", "gameGetOrder": "/hdtool/getOrderInfo", "gameSubmit": "/hdtool/gameSubmit", "doSubmit": "/hdtool/submit", "adslotId": "", "consumerId": "1", "isNotLoginUser": false, "uid": "1", "hdType": "duiba", "hdToolId": "42363", "appType": "credits", "subType": "custom", "directSendCoupon": "false", "ajaxAction": "", "recommendQueue": "/recommend/getRecommend", "recommendSkin": "/recommend/getRecommendSkin", "isShowDetail": true, "preview": false, "from": "", "login": "//activity.m.duiba.com.cn/hdtool/login?dpm=1.3.3.0", "flowRedirectUrl": "", "flowRedirectTuiaUrl": "", "isOpenRecommend": false, "getCreditsLink": "http://baidu.com?uid=1&dbnewopen", "appId": "1", "recordUrl": "//activity.m.duiba.com.cn/crecord/record?dbnewopen&dpm=1.3.2.0", "shareDesc": "分享分享文案文案", "entranceDesc": "测试领奖,也可到我的奖品领奖,24小时内有效哦", "isSHowMeat": true, "needCouponModal": true, "needRecommendModal": true, "asyncFiles": [], "shareAndroidLinkActivity": "http://www.duiba.com.cn", "shareIosLinkActivity": "http://www.iqiyi.com", "appName": "custom", "needShare": true, "shareTitle": "", "shareSubTitle": "", "sharePicUrl": "", "shareLink": "", "shareAndroidDeeplink": "", "shareIOSDeeplink": "" };
function requirelogin() {
console.log('requirelogin');
}
setTimeout(function () {
var loadingEl = document.getElementById('loading');
function onProcess(p) {
if (p >= 1) {
loadingEl.style.display = 'none';
}
}
var options = {};//window['inputOptions'] ||
window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
</script>
<script>
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
':35729/livereload.js?snipver=1"></' + 'script>')
</script>
</body>
</html>
\ No newline at end of file
{
"name": "shuijf",
"engineConfig": {
"fps": 63,
"designWidth": 750,
"designHeight": 1624,
"scaleMode": "fixedWidth",
"modifyCanvasSize": false,
"resPath": ""
},
"customConfig": {
"scene": {
"scenes": {
"main": "scenes/main.scene"
},
"entryScene": "main"
},
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl": "http://localhost:4001"
},
"dataCenterConfig": {
"dataCenterRoot": [
"API",
"CFG"
]
}
}
{"success":true,"code":"0000000000","desc":"OK","timestamp":1548915321930,"data":123456}
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1548915321930,
"data": 123456
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1552025592298,
"data": {
"element": null,
"rule": null,
"questions": [
{
"id": 1,
"type": "text",
"name": "题目1",
"options": [
{
"optionId": 1,
"option": "1"
},
{
"optionId": 2,
"option": "2"
},
{
"optionId": 3,
"option": "3"
},
{
"optionId": 4,
"option": "4"
}
]
},
{
"id": 3,
"type": "text",
"name": "题目3",
"options": [
{
"optionId": 1,
"option": "1"
},
{
"optionId": 2,
"option": "2"
},
{
"optionId": 3,
"option": "3"
},
{
"optionId": 4,
"option": "4"
}
]
}
]
}
}
\ No newline at end of file
......@@ -29,41 +29,47 @@ registerDef('components/other/FullStageSize', component6);
import component7 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component7);
import component8 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component8);
import component8 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component8);
import component9 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component9);
import component10 from 'components/other/CameraController';
registerDef('components/other/CameraController', component10);
import component10 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component10);
import component11 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component11);
import component11 from 'components/other/CameraController';
registerDef('components/other/CameraController', component11);
import component12 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component12);
import component12 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component12);
import component13 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component13);
import component13 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component13);
import component14 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component14);
import component14 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component14);
import component15 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component15);
import component15 from '../../assets/scripts/scenes/SceneController';
registerDef('./scripts/scenes/SceneController', component15);
import component16 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component16);
import component16 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component16);
import component17 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component17);
import component17 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component17);
import component18 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component18);
import component18 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component18);
import component19 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component19);
import component19 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component19);
import component20 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component20);
import component20 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component20);
import component21 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component21);
import component22 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component22);
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