Egret成语大挑战-场景关卡等级逻辑(三)
class SceneLevel extends eui.Component implements eui.UIComponent {
public btn_back: eui.Button;
public sc_level: eui.Scroller;
public gp_level: eui.Group;
public img_arrow: eui.Image; //箭头
// 声明数组 存放关卡按钮
private levelIcons: LevelIcon[] = [];
// 当前选择的关卡
private sel_levle: number;
private static shared: SceneLevel;
public static getInstance() {
if (!SceneLevel.shared) {
SceneLevel.shared = new SceneLevel();
}
return SceneLevel.shared;
}
public constructor() {
super();
}
protected partAdded(partName: string, instance: any): void {
super.partAdded(partName, instance);
}
protected childrenCreated(): void {
super.childrenCreated();
this.init();
}
private init() {
this.btn_back.addEventListener(egret.TouchEvent.TOUCH_TAP, this.backCallBack, this);
// scroller 关闭水平方向滚动
this.sc_level.scrollPolicyH = eui.ScrollPolicy.OFF;
//20行*10列
let col = 10;
let row = 20;
let icon_width = this.width / col;
let icon_height = this.height / row;
//创建icon的group添加到scroller上
let group: eui.Group = new eui.Group();
this.gp_level.addChild(group);
group.width = this.width;
// 每个icon的高度 * 总关卡数
group.height = icon_height * LevelDataManager.getInstance().totalLevels;
// 填充背景图
for (let i: number = 0; i < group.height / this.height; i++) {
let img_bg: eui.Image = new eui.Image(“GameBG2_jpg”);
img_bg.y = i * this.height;
this.gp_level.addChildAt(img_bg, 0);
}
//获取当前游戏的进度
let milestrone: number = LevelDataManager.getInstance().Milestone;
//设置关卡icon
for (let i: number = 0; i < LevelDataManager.getInstance().totalLevels; i++) {
let icon: LevelIcon = new LevelIcon();
group.addChild(icon);
icon.Level = i + 1;
icon.x = Math.sin(icon_height * i / 2 / 180 * Math.PI) * 200 + group.width / 2;
icon.y = group.height – icon_height * i – icon.height;
//给按钮添加点击事件回调
icon.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapIcon, this);
//设置关卡按钮的状态 是否可以点击
icon.enabled = i < milestrone; // 把关卡按钮存入数组 this.levelIcons.push(icon); } //scroller滚动到底部 this.gp_level.scrollV = group.height – this.height; //让目前进度处于屏幕最上端(假设,我玩到了25关,让25关出现在最顶层) if (milestrone > 20) {
this.gp_level.scrollV = group.height – milestrone * icon_height;
}
//设置箭头位置
this.img_arrow.anchorOffsetX = this.img_arrow.width / 2;
this.img_arrow.anchorOffsetY = this.img_arrow.height;
let curretIcon: LevelIcon = this.levelIcons[milestrone – 1];
this.img_arrow.x = curretIcon.x + curretIcon.width / 2;
this.img_arrow.y = curretIcon.y;
//将箭头显示在最上层
this.gp_level.addChild(this.img_arrow);
//设置当前选择的关卡
this.sel_levle = milestrone;
}
private backCallBack() {
SoundManage.getInstance().playClick();
this.parent.addChild(SceneBegin.getInstance());
this.parent.removeChild(this);
}
/**
* 点击关卡按钮
*/
private onTapIcon(event) {
// 播放点击音效
SoundManage.getInstance().playClick();
// 获取当前点击的关卡
let tg_icon: LevelIcon = event.currentTarget;
this.sel_levle = tg_icon.Level;
// let currentLevel = LevelDataManager.getInstance().Milestone;
// 设置箭头的位置为当前点击关卡的位置
this.img_arrow.x = tg_icon.x + tg_icon.width / 2;
this.img_arrow.y = tg_icon.y;
// 跳转场景
this.parent.addChild( SceneGame.getInstance() );
this.parent.removeChild(this);
SceneGame.getInstance().initLevelData(tg_icon.Level);
}
public setMileStoneLevel(level: number) {
var icon = this.levelIcons[level – 1];
icon.enabled = true;
this.img_arrow.x = icon.x + icon.width / 2;
this.img_arrow.y = icon.y;
if (level > LevelDataManager.getInstance().Milestone) {
LevelDataManager.getInstance().Milestone = level;
}
}
}

com 20 E2 AD 90 20Is 20There 20A 20Generic 20Drug 20For 20Viagra 20 20Viagra 20Cijena 20U 20Hrvatskoj viagra cijena u hrvatskoj Transcept has struggled to lift sales of its lead drug, Intermezzo, since it hit the market in April 2012 60mg priligy
does priligy work There are several ways to differentiate megakaryocytes from iPSCs
References:
Online casino new jersey
References:
https://hedgedoc.eclair.ec-lyon.fr/s/xWt-79RXq
References:
Female bodybuilding steroids pictures
References:
https://kingpeter.ewsstagging.com/shantaecarlino
References:
Mobile blackjack
References:
https://invastu.kz/user/librairis07/
References:
Steroid stack for beginners
References:
https://www.trauerrednerin-flensburg.de/da/Gedankeninsel/index.php/;focus=STRATP_com_cm4all_wdn_Flatpress_51354333&path=?x=entry:entry240819-103817%3Bcomments:1
References:
Best muscle stack 2015
References:
http://118.89.79.106/dustinmellor5
References:
Deca for cutting
References:
https://unired.zz.com.ve/@laurindahutche
References:
Best stack for cutting fat and gaining muscle
References:
https://drarchina.com/demo/@jimmyinwood999?page=about
References:
Testosterone steroid cycle
References:
https://git.barneo-tech.com/alexismerrifie/5285git.secretserver.club/wiki/Dianabol-Legal%3F-The-Truth-About-the-Steroid
References:
Tren steroid side effects
References:
https://syq.im:2025/marquisellis97/644943.138.83.20/wiki/How-Micronutrient-Deficiencies-Can-Sabotage-Your-Testosterone-Levels
References:
Deca steroid injection
References:
https://gitea.zachl.tech/brigettemoulto
References:
Steroid statistics 2016
References:
https://www.prosellconsulting.com/employer/testosterone-boosters-how-to-boost-testosterone-naturally-over-50/
References:
Which of the following are functions of steroids? select all that apply.
References:
http://38.47.180.165:3000/venettaerickso
You reported that superbly.
References:
https://cineblog01.rest/user/versepansy4/
References:
Instant Casino Auszahlungsdauer
References:
https://bookmarking.stream/story.php?title=instant-casino-online-login-registrierung-casino-konto-anmelden
References:
Instant Casino aktuelle Angebote
References:
https://sportpoisktv.ru/author/harpkettle6/
References:
Instant Casino Login vergessen
References:
https://hackmd.okfn.de/s/S1V1D4NoZe
References:
Instant Casino Seriosität
References:
https://postheaven.net/brasswhale17/online-casino-mit-den-schnellsten-auszahlungen-in-deutschland
References:
Casino duisburg permanenzen
References:
https://mclamb-jiang.mdwrite.net/best-online-casino-for-aussies
References:
Casino games slots
References:
https://aagesen-li.hubstack.net/makeberry-affiliates-becomes-the-direct-advertiser-for-winspirit-and-rocketplay-casino
References:
Are steroids and testosterone the same thing
References:
https://hedgedoc.eclair.ec-lyon.fr/s/2C1Q5SfASB
References:
What are the side effects of anabolic steroids
References:
https://posteezy.com/clenbuterol-wirkung-nebenwirkungen-dosierung
anabolic herbs
References:
https://md.un-hack-bar.de/s/OzkJMw2Q8R
References:
Online Casino Echtgeld Live Dealer
References:
https://urlscan.io/result/019d8669-4089-7590-a714-8ce81d589f95/
References:
Oaks casino towers brisbane
References:
http://bioimagingcore.be/q2a/user/hyenateam9
References:
Quick hit slots
References:
https://notes.bmcs.one/s/H4-wtMGdzG
References:
Slot machine parts
References:
https://zenwriting.net/pigjet9/online-slots-echtgeld-fur-beste-gewinne
References:
Echtgeld Casino ohne Einzahlung
References:
https://hack.allmende.io/s/CMPKLxZ0P
References:
Royal reels https://graph.org/Ripper-Casino-Complete-Review–Player-Guide-04-20 latest bonuses
References:
Lucky casino
References:
https://graph.org/Woo-Casino-Review-Is-This-Top-Rated-Online-Casino-Right-for-You-04-20
References:
Venetian casino las vegas
References:
https://ice-casino-no-deposit-bonus.online-spielhallen.de/
References:
Rapunzel video
References:
https://casino-gewinne.online-spielhallen.de/
References:
Nuremberg (Nürnberg)
References:
https://online-casino-sperren-lassen.online-spielhallen.de/
References:
Stuttgart
References:
https://lucky-fox-casino.online-spielhallen.de/
References:
Casino texas
References:
https://graph.org/Can-You-Stay-At-Star-Casino-Brisbane-04-27
References:
Fakta om casino udbetalingsprocenter
References:
https://jobs.assist24-7.com/employer/hurtige-casinoer-find-casinoer-med-hurtig-udbetaling-2026/
References:
Bedste udbetaling på danske casinoer
References:
https://greecestudies.site/wiki/Bedste_Online_Casino_Udbetaling_Med_Hje_Gevinster_2026
888 starz uz http://888starz-uz3.org .
موقع 888starz https://888starz-egypt9.com/
888старз 888старз .
888starz 1xbet 888starz 1xbet .
888 مباشر https://888starz-egyp.com/
888strz استار888
References:
Online casino usa https://demo.indeksyazilim.com/helaine737790
References:
Good game sites https://jobs.khtp.com.my/employer/70878/online-pokies-australia-2026-play-real-money-free-pokies/
References:
Valley view casino san diego https://git.nathanspackman.com/altonslowik229
References:
Hoosier park racing and casino https://gitea-inner.fontree.cn/kazukobridgefo/7812325/wiki/Play-Free-Microgaming-Slots-Online-Best-Demo-Games-from-Microgaming
References:
Manoir richelieu charlevoix https://ripematch.com/@brandonk583481
References:
Online casino biz http://amazonrainforest.org/ActivityFeed/MyProfile/tabid/61/UserId/259898/Default.aspx
References:
Sun vegas casino https://code.wemediacn.com/suebronson6349/5059microgaming-loyalty-bonus/wiki/Microgaming-No-Deposit-Casino-Bonus-Codes-for-May-2026
true fortune 50 free spins no deposit truefortunecasinos.uk .
true fortune gaming true fortune gaming .
true fortune free bonus https://truefortunecasinos.uk .
true fortune promo code 2026 true fortune promo code 2026 .