Commit c8ec6a6a authored by 刘畅's avatar 刘畅

superman

parent d811d190
This diff is collapsed.
export class Buried {
appId;
consumerId;
oaId;
/**
* 初始化
*/
static init() {
// appId = window["appId"];
// oaId = window["projectId"];
this.appId = window.CFG.appID;
this.oaId = window.CFG.projectId;
}
/**
* 创建dpm埋点数据
* @param {string} dpm 点击埋点
* @param {string} dcm 曝光埋点
* @param {string} embedDomain 埋点域名
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/
static createExposure(dpm, dcm, embedDomain = '//embedlog.duiba.com.cn') {
let dom
dom = "1.0.0.0"
const exposure = {
dpm: dpm,
dcm: dcm,
// dom: dom,
appId: Buried.appId,
domain: embedDomain
};
return exposure;
}
/**
* dpm拼接
* @param pageId 页面ID
* @param area 区域
* @param dpm 埋点号
* @returns {string}
*/
static connectDpm(pageId, area, dpm) {
return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;
}
/**
* dcm拼接
* @param typeId 类型ID
* @param contentInfo 内容信息
* @param dcm 埋点号
* @returns {string}
*/
static connectDcm(typeId, contentInfo, dcm) {
return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;
}
/**
* 插件dcm拼接
* @param plugId 插件ID
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
static connectPlugDcm(plugId, type) {
return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;
}
/**
* 活动dcm拼接
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
static connectActivityDcm(type) {
return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;
}
}
import { Buried } from "./Buried";
export class NetBuried {
// constructor() { }
exposure = []
dpm = []
dcm = []
showLog(i, d) {
var appId = window.CFG.appID || 77208;
var oaId = window.CFG.projectId;
if (d) {
this.dpm[i] = `${appId}.110.${i}.${d}`;
} else {
this.dpm[i] = `${appId}.110.${i}.1`;
}
this.dcm[i] = `202.${oaId}.0.0`;
this.exposure[i] = Buried.createExposure(this.dpm[i], this.dcm[i]);
this._showLog(this.exposure[i]);
}
clickLog(i, d) {
var appId = window.CFG.appID || 77208;
var oaId = window.CFG.projectId;
if (d) {
this.dpm[i] = `${appId}.110.${i}.${d}`;
} else {
this.dpm[i] = `${appId}.110.${i}.1`;
}
this.dcm[i] = `202.${oaId}.0.0`;
this.exposure[i] = Buried.createExposure(this.dpm[i], this.dcm[i]);
this._clickLog(this.exposure[i]);
}
/**
* 兑吧点击埋点
* @param {IExposureData} exposure
*/
_clickLog(exposure) {
const net = {
name: 'clickLog',
uri: '/log/click',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
this.send(net);
}
/**
* 兑吧曝光埋点
* @param {IExposureData} exposure
*/
_showLog(exposure) {
const net = {
name: 'showLog',
uri: exposure.domain + '/exposure/standard',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
this.send(net);
}
/**
* 发送请求
* @param net
*/
send(net) {
let realUrl = net.uri;
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if (net.addUrl) {
realUrl += net.addUrl;
}
window['$'].ajax({
type: net.type,
url: realUrl,
dataType: net.dataType,
data: net.param,
async: true,
success: (result) => {
},
error: (message) => {
}
});
}
}
\ No newline at end of file
/**
* Created by renjianfeng on 2020-03-13.
*/
const customId = 'superman';
(async function () {
let customModule = await fetch(`../meta.json`);
customModule = await customModule.json();
console.log(customModule);
await loadAssets(customModule.assets);
launchWithCustomModule(customModule);
})();
function launchWithCustomModule(customModule) {
//engine.registerCustomCodeModule(customModule);
engine.registerCustomModule(customId, window[customId]);
const { props: propsOption, assets } = customModule;
let props = engine.computeProps(customModuleProps, propsOption);
const customModuleIns = {
id: customId,
props,
assets,
};
engine.registerCustomModules([customModuleIns]);
engine.launchWithConfig({
options: {
entrySceneView: 'entry',
},
assets: [],
views: [{
name: 'entry',
type: 'node',
properties: {
x: 0,
y: 0,
}
}],
customs: [],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-setProjectId',{projectId:"wegg",appId:"77205"})
// },1000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-ActLabel',{type:2})
// },1000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-ActLabel',{type:3})
// },2000);
// // const d = engine.gameStage.sceneContainer.getChildAt(0);
// // engine.gameStage.sceneContainer.getChildAt(0).x = (d.stage.width-props.W)/2;
// // engine.gameStage.sceneContainer.getChildAt(0).y = (d.stage.height-props.H)/2;
// }, 3000);
// setTimeout(()=>{
// engine.globalEvent.dispatchEvent("pictures-reset",{})
// },10000);
// setTimeout(() => {
// engine.globalEvent.dispatchEvent('pictures-start', {
// picUrl: "http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png",
// // picUrl: "http://yun.duiba.com.cn/aurora/assets/d23e73d37ec01931e48cbd0a4095367044c5675c.png"
// blockUrl: "888"
// });
// }, 30*1000);
});
// engine.globalEvent.addEventListener('pictures-game-fail', (e) => {
// console.log(e.type, e.data);
// });
// engine.globalEvent.addEventListener('pictures-game-success', (e) => {
// console.log(e.type, e.data);
// });
}
function getAssetByUUID(uuid) {
return engine.resolveCustomAsset(customId, uuid);
}
function getProps() {
return engine.getProps(customId);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</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 {
padding: 0;
margin: 0;
border: 0;
width: 100%;
height: 100%;
overflow: hidden;
position: absolute;
background-color: gray;
}
.game-container{
width: 100%;
height: 100%;
line-height:0;
font-size:0;
}
</style>
</head>
<body>
<div id="game-container" class="game-container"></div>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/editor/zeroing/libs/engine.1de84ff79dba19e949088de63aa75af51a515e5c.js"></script>
<script crossorigin="anonymous" src="//yun.duiba.com.cn/editor/zeroing/libs/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"></script>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<!-- <script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script> -->
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script src="app.js"></script>
<script src="props.js"></script>
<script src="load-assets.js"></script>
<script src="main.js"></script>
<script>
</script>
</body>
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
const assets = [
{
"name": "玩家icon",
"url": "//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png",
"uuid": "888",
"ext": ".png"
},
{
"name": "雨滴",
"url": "//yun.duiba.com.cn/aurora/assets/8564c8c9be3aead71b05a0bab8d7d07ac3f778a1.png",
"uuid": "264a6192-d7bf-45e8-8f15-6ba2c439a532",
"ext": ".png"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/171e92283cd13c013ee1b76d28d252ff08815d47.png",
"uuid": "eb88b42d-e151-4c1b-94b9-7c16f7bfac29",
"ext": ".png"
},
{
"name": "石块",
"url": "//yun.duiba.com.cn/aurora/assets/99b0af0c59fe79a415a3f032149cfacc27e3ac2c.png",
"uuid": "ab1bdabc-21ba-46bf-9299-6c638f766c88",
"ext": ".png"
},
{
"name": "水花",
"url": "//yun.duiba.com.cn/aurora/assets/93d37b4a0e367e80e375308a6b4414d72d7666fc.svga",
"uuid": "b521bf94-20e1-44dd-8eca-d24996cbaeae",
"ext": ".svga"
},
{
"name": "炸弹",
"url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
"uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
"ext": ".svga"
},
{
"name": "玩家",
"url": "//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga",
"uuid": "71d8dcbc-3931-471a-b585-b3ae01b25aa6",
"ext": ".svga"
}
];
function loadAssets(customModuleAssets, onProgress, onComplete){
return engine.loadAssets(assets.concat(...customModuleAssets), onProgress, onComplete);
}
This diff is collapsed.
This diff is collapsed.
/**
* Created by rockyl on 2020-01-21.
*/
let customModuleProps = {
};
{
"name": "蛋黄超人自定义模块",
"desc": "蛋黄超人自定义模块1.0",
"props": {
"QTextStrArr":{
"alias":"问题文案组,用逗号隔开,不填为默认",
"type":"string",
"default":"1、什么是筑梦空间?,2、金币是什么?,3、怎么获得金币?,4、如何更改用户昵称?,5、个人信息可以进行哪些操作?,6、通过二维码添加好友之后在哪里查看?,7、我的勋章是什么?,8、任务有哪些分类?"
},
"ATextStrArr":{
"alias":"答案文案组,用逗号隔开,不填为默认",
"type":"string",
"default":"筑梦空间带给用户吃喝玩乐的不同体验,在这里你可以进行生活缴费、体验本地优惠、建设我的庄园、畅玩游戏中心等等。,金币是筑梦空间中的虚拟货币,用户可以使用金币游玩游戏、种植植物、兑换实物,同时金币可以按一定比例兑换波豆,波豆可以在波豆商城兑换更丰富的商品。,用户可以通过签到、任务、参与活动以及我的庄园果实售卖方式获得金币。,用户可以点击左上角个人信息按钮进入个人信息弹窗,点击昵称旁的修改按钮对昵称进行修改。,用户可以在个人信息页面进行修改昵称、修改头像、兑换波豆、查询金币明细、扫二维码添加好友等操作。,用户A通过扫描用户B的二维码进入活动之后,双方即绑定为好友,可以排行榜-好友排行榜进行查看。,当用户在筑梦空间的各种行为动作达到一定次数时,会点亮相应的激励勋章。,任务中分为一次性任务、永久开放任务和周期更新任务,一次性任务为完成一次或多次后消失的任务,如浏览车主服务任务、升级房屋任务;永久开放任务为一直可以完成并获得奖励的任务,如邀请好友任务;周期任务为以周期(每日/周/月)为单位进行更新的任务,如分享筑梦空间、去商店购买种子任务,积极完成任务可以获得更多金币。"
},
"ACTTextStrArr":{
"alias":"互动文案组,用逗号隔开,不填为默认",
"type":"string",
"default":"主人你多久没来看我了,我好想你啊,Whoooo,主人你太棒了,主人,果子都成熟了,赶紧去采摘吧,主人,有空地可以种植哦,赶紧去吧!"
},
"type":{
"alias":"类型,用于区分所在场景,用于埋点,0:首页,1:庄园",
"type":"number",
"default":"0"
}
},
"assets": [
{
"name": "大对话泡",
"url": "//yun.duiba.com.cn/aurora/assets/a3d49f913ee300b2834260967010a2e7b2d5c265.png",
"uuid": "21d8b7ca-6ed3-44e5-ada0-f0433f471ac9",
"ext": ".png"
},
{
"name": "小对话泡",
"url": "//yun.duiba.com.cn/aurora/assets/c034f14785a2a36dce266cef0f46bd783ad03cb2.png",
"uuid": "9e4d1860-4762-4ac1-bc44-b3dd8fb307a6",
"ext": ".png"
},
{
"name": "蛋黄超人关闭按钮",
"url": "//yun.duiba.com.cn/aurora/assets/7a346d4e2c2cbce5ab3ac0a74e481525b048fcdd.png",
"uuid": "76f2c800-2174-4a90-ad6d-5853e95eb144",
"ext": ".png"
},
{
"name": "返回按钮",
"url": "//yun.duiba.com.cn/aurora/assets/8f55741c71b2aa7babe5cc517707cdd51b33c3d9.png",
"uuid": "2a555da9-dc05-4046-a5fb-551f0c2692fa",
"ext": ".png"
},
{
"name":"蛋黄超人icon",
"url":"//yun.duiba.com.cn/aurora/assets/baeec26a873006fabf031af8c918153384a732ef.png",
"uuid":"d5df1198-2cad-42e0-a197-fd56a2502d99",
"ext":".png"
},
{
"name":"蛋黄超人名称",
"url":"//yun.duiba.com.cn/aurora/assets/11b02c3908bcb8d685610caafdab9785fac5fccf.png",
"uuid":"fef58cbd-9c24-4216-896a-2799011df1dc",
"ext":".png"
},
{
"name":"右箭头",
"url":"//yun.duiba.com.cn/aurora/assets/8be77ba8ce699c4d302cd58e4d3be06919ac732f.png",
"uuid":"8546dcf7-a6e8-4ba2-89f7-b929118e473a",
"ext":".png"
},
{
"name":"常规呼吸动作",
"url":"//yun.duiba.com.cn/aurora/assets/adc7212454ea1d84ac5824982a57f37d2e745b54.svga",
"uuid":"ba2f8259-71b5-49ac-8310-08538a6b5d07",
"ext":".svga"
},
{
"name":"招手",
"url":"//yun.duiba.com.cn/aurora/assets/cf78c2f55369b597dfc744159687dc255f18a2b4.svga",
"uuid":"97de87e9-2ea4-4a31-9986-25edcd807c05",
"ext":".svga"
}
],
"events": {
"in": {
"pictures-ActLabel":{
"alias":"互动显示",
"data":{
"type":"0:24小时未登录互动,1:任务完成互动,2:农作物成熟互动,3:有土地未种植互动"
}
},
"pictures-setProjectId":{
"alias":"设置星速台id与appid",
"data":{
"projectId":"默认为'0'",
"appId":"默认为'0'"
}
}
},
"out": {
"pictures-end": {
"alias": "结束"
}
}
}
}
\ No newline at end of file
// import { DataManager } from './../manager/DataManager';
import { IExposureData } from './IExposureData';
// import { IExposureData } from '..';
export class Buried {
public static appId: string = '0';
public static consumerId: number;
public static oaId: string = "0";
/**
* 初始化
*/
public static init(): void {
// if(DataManager.ins.gameCfgData) {
// this.appId = DataManager.ins.gameCfgData.appInfo.appId;
// this.consumerId = DataManager.ins.getInfoData.consumerId;
// this.oaId = DataManager.ins.gameCfgData.gameInfo.oaId;
// } else if(DataManager.ins.customCfgData){
// this.appId = DataManager.ins.customCfgData.appId;
// this.consumerId = DataManager.ins.customCfgData.consumerId;
// this.oaId = DataManager.ins.customCfgData.oaId ;
// } else if(DataManager.ins.petIndexData && DataManager.ins.petIndexData.appId && DataManager.ins.petIndexData.activityId){
// this.appId = DataManager.ins.petIndexData.appId;
// this.consumerId = DataManager.ins.petIndexData.consumerId;
// this.oaId = DataManager.ins.petIndexData.activityId ;
// } else if(DataManager.ins.petsIndexData && DataManager.ins.petsIndexData.appId && DataManager.ins.petsIndexData.activityId){
// this.appId = DataManager.ins.petsIndexData.appId;
// this.consumerId = DataManager.ins.petsIndexData.consumerId;
// this.oaId = DataManager.ins.petsIndexData.activityId ;
// }
}
/**
* 创建dpm埋点数据
* @param {string} dpm 点击埋点
* @param {string} dcm 曝光埋点
* @param {string} embedDomain 埋点域名
* @returns {{dpm: string; consumerId: number; domain: string; appId: number}}
*/
public static createExposure(dpm: string, dcm: string, embedDomain = '//embedlog.duiba.com.cn'): IExposureData {
const exposure: any = {
dpm: dpm,
dcm: dcm,
appId: Buried.appId,
domain: embedDomain
};
return exposure;
}
/**
* dpm拼接
* @param pageId 页面ID
* @param area 区域
* @param dpm 埋点号
* @returns {string}
*/
public static connectDpm(pageId: number, area: number, dpm: number): string {
return Buried.appId + '.' + pageId + '.' + area + '.' + dpm;
}
/**
* dcm拼接
* @param typeId 类型ID
* @param contentInfo 内容信息
* @param dcm 埋点号
* @returns {string}
*/
public static connectDcm(typeId: number, contentInfo: number, dcm: number): string {
return typeId + '.' + Buried.oaId + '.' + contentInfo + '.' + dcm;
}
/**
* 插件dcm拼接
* @param plugId 插件ID
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
public static connectPlugDcm(plugId: number, type: number): string {
return 212 + '.' + plugId + '.' + type + '.' + Buried.oaId;
}
/**
* 活动dcm拼接
* @param type 1 活动工具 2 主会场 4 楼层 5 游戏 7 子页面
* @returns {string}
*/
public static connectActivityDcm(type: number): string {
return 202 + '.' + Buried.oaId + '.' + type + '.' + Buried.oaId;
}
}
export class GTime {
/**
* 获取当前时间戳
* @returns {number}
*/
public static getTimestamp(): number {
return new Date().getTime();
}
/**
* 转化时分秒
* @param time
*/
public static GetTimeHMS(time:number):string{
let t;
let h = Math.floor(time / 3600);
let hstr = h > 9 ? h : '0' + h;
let m = Math.floor((time % 3600) / 60);
let mstr = m > 9 ? m : '0' + m;
let s = Math.floor(time % 60);
let sstr = s > 9 ? s : '0' + s;
t = hstr + ':' + mstr + ':' + sstr;
return t;
}
/**
* 转化分秒
* @param time
*/
public static GetTimeMS(time:number):string{
let t;
let m = Math.floor((time % 3600) / 60);
let mstr = m > 9 ? m : '0' + m;
let s = Math.floor(time % 60);
let sstr = s > 9 ? s : '0' + s;
t = mstr + ':' + sstr;
return t;
}
}
\ No newline at end of file
This diff is collapsed.
// import GameView from "./GameView";
import { injectProps } from "../props";
import TestView from './TestView'
import { Buried } from "./Buried";
export class GameWrapper extends engine.Container{
// private _gameView:GameView
private _testView:TestView
constructor(){
super();
// engine.globalEvent.addEventListener('pictures-start', this.start, this);
// engine.globalEvent.addEventListener('pictures-stop', this.stop, this);
engine.globalEvent.addEventListener("pictures-setProjectId",this.setProjectId,this);
//创建实例
// let gameView = this._gameView = new GameView();
// this.addChild(gameView);
let testView = this._testView = new TestView();
this.addChild(testView);
}
setProjectId(event:engine.Event){
injectProps(event.data);
Buried.oaId = event.data.projectId;
Buried.appId = event.data.appId;
}
start(event: engine.Event) {
injectProps(event.data);
// this._status = 1;
// this._testView.start();
}
stop(event: engine.Event) {
// this._testView.stop();
}
}
\ No newline at end of file
/**
*Created by cuiliqiang on 2018/3/1
* 埋点信息
*/
export interface IExposureData {
activityId?: number;
activityUseType?: string;
advertId?: number;
appId: number;
consumerId: number;
dcm: string;
domain: string;
dpm: string;
ip?: string;
isEmbed?: boolean;
materialId?: number;
orderId?: string;
os?: string;
}
\ No newline at end of file
export interface INetData {
//名字
name: any;
//地址
uri: string;
//接口类型 get、post等
type: string;
//返回数据类型
dataType: string;
//参数
param: any;
//回调
callback: Function;
//轮询次数
pollingCount?: number;
//轮询条件检查
pollingCheck?: Function;
//url拼接内容
addUrl?: string;
//是否显示错误提示
hideMsg?: boolean;
}
\ No newline at end of file
This diff is collapsed.
import {getTexture, createSvga, showLog, clickLog} from './utils'
import QAText from './QAText';
import {getlogItem} from './getlogItem';
import { props } from '../props';
export default class TestView extends engine.Container{
worldTime:number;
supermanImg:engine.Image;
qaisOpen:boolean = false;
QAText:QAText;
breathSvga:svga.Svga;
waveSvga:svga.Svga;
rect:engine.Rect;
constructor(){
super()
this.addEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
setup(){
var that = this;
that.removeEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this)
that.rect = new engine.Rect();
that.rect.fillColor = "#000000";
that.rect.alpha = 0.7;
that.rect.width = 2000;
that.rect.height = 2000;
that.rect.visible = false;
that.addChild(that.rect);
that.breathSvga = createSvga("常规呼吸动作");
that.waveSvga = createSvga("招手");
that.waveSvga.visible = false;
that.breathSvga.visible = true;
that.breathSvga.mouseEnabled = that.waveSvga.mouseEnabled = true;
that.addChild(that.breathSvga);
that.addChild(that.waveSvga);
that.breathSvga.x = that.waveSvga.x = engine.gameStage.stage.width - 178*0.7;
that.breathSvga.y = that.waveSvga.y = engine.gameStage.stage.height/3*2-60;
that.breathSvga.gotoAndPlay(1);
// that.breathSvga.scale = 0.6;
// that.waveSvga.scale = 0.6;
that.breathSvga.scaleX = that.breathSvga.scaleY = 0.7;
that.waveSvga.scaleX = that.waveSvga.scaleY = 0.7;
that.QAText = new QAText();
that.addChild(that.QAText);
that.QAText.setBigBgPositon(engine.gameStage.stage.width - that.QAText.getBigBgSize().w-35,engine.gameStage.stage.height/3*2-60 - that.QAText.getBigBgSize().h)
that.QAText.setSmallBgPositon(engine.gameStage.stage.width - that.QAText.getSmallBgSize().w-35,engine.gameStage.stage.height/3*2-60 - that.QAText.getSmallBgSize().h)
that.addEvnt();
}
addEvnt(){
var that = this;
// that.supermanImg.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);
that.breathSvga.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);
that.waveSvga.addEventListener(engine.MouseEvent.CLICK,that.touchSuperManImg,that);
engine.globalEvent.addEventListener("pictures-ActLabel",that.showActLabelGroup,that);
engine.globalEvent.addEventListener("pictures-supermanAnim",that.supermanAnim,that);
engine.globalEvent.addEventListener("hideRect",()=>{that.rect.visible = false},that);
}
/**蛋黄超人动效 */
supermanAnim(){
}
/**点击蛋黄超人 */
touchSuperManImg(e:engine.MouseEvent){
console.log("点击蛋黄超人")
var that = this;
if(that.QAText.visible) return;
if(props.type == 0){
clickLog(getlogItem(17))
}else if(props.type == 1){
clickLog(getlogItem(51))
}
//蛋黄超人动效
that.showWaveSvga();
that.QAText.showQLabelGroup(null);
that.rect.visible = true;
}
/**展示互动文案组 */
showActLabelGroup(e:engine.Event){
var that = this;
//蛋黄超人动效
that.showWaveSvga();
that.QAText.showActLabelGroup(parseInt(e.data.type))
}
showWaveSvga(){
var that = this;
that.breathSvga.visible = false;
that.waveSvga.visible = true;
that.waveSvga.play(false,false);
that.waveSvga.once(engine.Event.END_FRAME,()=>{
that.waveSvga.visible = false;
that.breathSvga.gotoAndPlay(1)
that.breathSvga.visible = true;
},that)
}
}
\ No newline at end of file
import { Buried } from "./Buried";
import {props} from '../props'
export const getlogItem = (i) =>{
const Dpm = Buried.connectDpm(110, i, 1); // 点击埋点
const Dcm = Buried.connectDcm(202, 0, 0); // 曝光埋点
return Buried.createExposure(Dpm, Dcm);
};
\ No newline at end of file
{
"a":1
}
\ No newline at end of file
/**
* Created by rockyl on 2020-01-21.
*/
import {IExposureData} from './IExposureData'
import {INetData} from './INetData'
import { GTime } from './GTime';
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function createSvga(name, anchorName?) {
let inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst;
}
export function getIndexFromRC(row,col,maxCol){
let index;
index = row * maxCol + col ;
return index
}
export function getRandomArray(array){
array.sort(function() {
return .5 - Math.random();
});
}
/**
* 兑吧点击埋点
* @param {IExposureData} exposure
*/
export function clickLog(exposure: IExposureData): void {
const net: INetData = {
name: 'clickLog',
uri: '/log/click',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
send(net);
}
/**
* 兑吧曝光埋点
* @param {IExposureData} exposure
*/
export function showLog(exposure: IExposureData): void {
const net: INetData = {
name: 'showLog',
uri: exposure.domain + '/exposure/standard',
type: 'get',
dataType: 'jsonp',
param: exposure,
callback: null,
hideMsg: true
};
send(net);
}
/**
* 发送请求
* @param net
*/
export function send(net: INetData): void {
let gTime: string = '?_=' + GTime.getTimestamp();
let realUrl: string = net.uri;
if (realUrl.indexOf('?') != -1) {
gTime = '&_=' + GTime.getTimestamp();
}
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if (net.addUrl) {
realUrl += net.addUrl;
}
window['$'].ajax({
type: net.type,
// url: realUrl + gTime,
url: realUrl,
cache: false,
dataType: net.dataType,
data: net.param,
async: true,
// success: (result) => {
// this.onResponse(net, result);
// },
// error: (message) => {
// this.onError(net);
// }
});
}
\ No newline at end of file
import {GameWrapper} from "./game/GameWrapper";
import {injectProps, prepareProps} from "./props";
export default function (props) {
prepareProps();
injectProps(props);
let instance = new GameWrapper();
return instance;
}
/**
* Created by rockyl on 2020-01-21.
*/
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
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