Commit 327c7643 authored by zhangjinzhou's avatar zhangjinzhou

气球,盲盒,星星宝箱暂存

parent 3c97d3bd
export enum CouponJoinScene{
BlindBox=0,//盲盒
//星级宝箱
StarBox1,
StarBox2,
StarBox3,
//通关
Checkpoint,
Buoy,
}
export interface CouponJoinOptions{
scene:CouponJoinScene,//场景
beforeUse:Function,//跳转前
afterClose:Function,//关闭
}
export interface ShowTurnCircleOptions{
afterClose:Function,//关闭转盘
}
export default class Utils {
constructor() {
......@@ -125,4 +143,23 @@ export default class Utils {
rect2.y = obj2.y;
return rect1.intersects(rect2);
}
//奖品相关弹窗
static couponJoin(scene:CouponJoinScene,beforeUse=()=>{},afterClose=()=>{}):void{
let options:CouponJoinOptions = {
scene:scene,
beforeUse:beforeUse,
afterClose:afterClose
}
console.error("奖品弹窗点击===》",scene);
beforeUse&&beforeUse();
afterClose&&afterClose();
}
//展示大转盘
static showTurnCircle(afterClose=()=>{}):void{
let options:ShowTurnCircleOptions = {
afterClose,
}
afterClose&&afterClose();
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -327,7 +327,17 @@ export const Chapters10: ChapterData[] = [
bubbleProbability: 0,
stepCount: 25,
passTarget: { type: 1, elements: [{ type: 0, count: 30 }, { type: 1, count: 36 }] },
starScores: [5000, 11000, 19000], map: { lattices: [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0], connectedLats: [[31, 67], [45, 63], [46, 64], [47, 65], [51, 69], [52, 70], [53, 71]], elements: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 0, type: null }, { index: 1, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 7, type: null }, { index: 8, type: null }] }
starScores: [5000, 11000, 19000], map: {
lattices: [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0], connectedLats: [[31, 67], [45, 63], [46, 64], [47, 65], [51, 69], [52, 70], [53, 71]], elements:
[
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], baseElements: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], recycles: [], generateLats: [{ index: 0, type: null }, { index: 1, type: null }, { index: 2, type: null }, { index: 3, type: null }, { index: 5, type: null }, { index: 6, type: null }, { index: 7, type: null }, { index: 8, type: null }]
}
},
//191
{
......
......@@ -175,8 +175,6 @@ export class Element extends eui.Component {
var texture: egret.Texture;
if(this.type==ElementType.BLIND_BOX){
texture = await loadImageByUrl("//yun.duiba.com.cn/aurora/assets/730048e95b89906c3a8076b88910ab272bc47d6f.jpeg");
console.error("盲盒网络图片显示===》",texture);
}else{
texture = RES.getRes(source);
}
......
import { loadImageByUrl } from "../../../libs/new_wx/loadSpriteSheet";
import Utils, { CouponJoinScene } from "../../Utils";
import { CurScoreNum } from "./CurScoreNum";
/**
......@@ -85,6 +87,7 @@ export class ScoreProgress {
mask.graphics.endFill();
}
/**
......@@ -93,7 +96,8 @@ export class ScoreProgress {
* @param scoreTxt 托管
* @param starScores
*/
constructor(starProgress: eui.Image, scoreTxt: CurScoreNum, starScores: number[]) {
constructor(starProgress: eui.Image, scoreTxt: CurScoreNum, starScores: number[],openStarDia) {
this.openStarDia = openStarDia;
this.starProgress = starProgress;
this.scoreTxt = scoreTxt;
this.starScores = starScores;
......@@ -120,5 +124,121 @@ export class ScoreProgress {
this.star3.x = 573;
this.star3.y = 76;
p.addChild(this.star3);
let starboxwid = 50;
let starboxhei = 50;
let starboxy = 25;
let starbox1x = 423;
let starbox2x = 498;
let starbox3x = 573;
this.starbox1 = new eui.Image();
this.starbox1.width = starboxwid;
this.starbox1.height = starboxhei;
p.addChild(this.starbox1);
this.starbox1.x = starbox1x;//-starboxwid/2;
this.starbox1.y = starboxy;
this.starbox2 = new eui.Image();
this.starbox2.width = starboxwid;
this.starbox2.height = starboxhei;
p.addChild(this.starbox2);
this.starbox2.x = starbox2x;//-starboxwid/2;
this.starbox2.y = starboxy;
this.starbox3 = new eui.Image();
this.starbox3.width = starboxwid;
this.starbox3.height = starboxhei;
p.addChild(this.starbox3);
this.starbox3.x = starbox3x;//-starboxwid/2;
this.starbox3.y = starboxy;
this.updateStarBox([2, 1, 0]);
this.starbox1.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickStar1,this);
this.starbox2.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickStar2,this);
this.starbox3.addEventListener(egret.TouchEvent.TOUCH_TAP,this.clickStar3,this);
}
//新增星星宝箱
starboxdata = [0, 0, 0];//0未开启,1待开启,2已开启
starbox1: eui.Image;
starbox2: eui.Image;
starbox3: eui.Image;
box1wid = 50;
box1hei = 50;
box2wid = 70;
box2hei = 70;
sbox1x = 423;
sbox2x = 498;
sbox3x = 573;
starwid = 46;
sboxy = 50;
updateStarBox(data) {
this.starboxdata = data;
this.setboxtex(0);
this.setboxtex(1);
this.setboxtex(2);
}
s1havetween = false;
s2havetween = false;
s3havetween = false;
openStarDia = null;
async setboxtex(idx) {
let sp: eui.Image = this["starbox" + (idx + 1)];
let data = this.starboxdata[idx];
let spx = this["sbox" + (idx + 1) + "x"];
let texurl = data == 2 ? "//yun.duiba.com.cn/aurora/assets/8312db117356184c07b0d67153ec67ba3ed16f9f.png" : "//yun.duiba.com.cn/aurora/assets/f565872fe14ec885c7a9935bc0cfc40515b81898.png";
sp.texture = await loadImageByUrl(texurl);
sp.width = data == 2 ? this.box2wid : this.box1wid;
sp.height = data == 2 ? this.box2hei : this.box1hei;
sp.anchorOffsetX = sp.width / 2;
sp.anchorOffsetY = sp.height / 2;
sp.x = spx + this.starwid / 2;// - sp.width / 2;
sp.y = this.sboxy;// - sp.height / 2;
if (data == 1) {
if (!this["s" + (idx + 1) + "havetween"]) {
this["s" + (idx + 1) + "havetween"] = true;
egret.Tween.get(sp, { loop: true }).to({
rotation: 30
}, 300)
.to({
rotation: -30
}, 600)
.to({
rotation: 0,
}, 300);
}
} else {
egret.Tween.removeTweens(sp);
}
}
//星星宝箱点击
clickStar1(){
if(this.starboxdata[0]==1){
this.openStarDia&&this.openStarDia(1);
}
}
clickStar2(){
if(this.starboxdata[1]==1){
this.openStarDia&&this.openStarDia(2);
}
}
clickStar3(){
if(this.starboxdata[2]==1){
this.openStarDia&&this.openStarDia(3);
}
}
}
\ No newline at end of file
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