Commit cf8e5248 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存233

parent f1341317
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/**
* Created by rockyl on 2019-12-16.
*/
const customId = 'gqtq-game';
(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,
}
}],
}, null, function () {
setTimeout(() => {
engine.addCustomModule(customId, engine.gameStage.sceneContainer.getChildAt(0));
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('game-init', {
prizedata:[
"鸡蛋",
"豆腐",
"西红柿",
"牛肉丸",
"玉米",
"红薯",
"谢谢参与",
]
});
}, 500);
});
}
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>国庆弹球</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: transparent;
}
</style>
</head>
<body>
<div id="game-container" style="line-height:0;font-size:0"></div>
<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/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.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 = [
];
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": "弹球抽奖模块",
"props": {
"guideText1": {
"alias": "引导1的文本",
"type": "string",
"default": "长按屏幕\n杆子变长即可通过"
},
"dotsarr":{
"alias": "碰撞圆点",
"type": "array<number>",
"default": "1,1,2,3,4,5"
}
},
"assets": [
{
"name": "gamebg",
"url":"//yun.duiba.com.cn/aurora/assets/21070d5b302402f69b9019616c647097961fd3ab.png",
"uuid": "gamebg",
"ext": ".png"
},
{
"name": "topimg",
"url": "//yun.duiba.com.cn/aurora/assets/754d7b059f021396f236b6380eb55f035060e37c.png",
"uuid": "topimg",
"ext": ".png"
},
{
"name": "ball",
"url": "//yun.duiba.com.cn/aurora/assets/1d87dcd08eded84a3d822a8d20fdd4824d7094b8.png",
"uuid": "ball",
"ext": ".png"
},
{
"name": "cuizi",
"url": "//yun.duiba.com.cn/aurora/assets/8a76770e4da012ac2a18b21e4d5a39851584077f.png",
"uuid": "cuizi",
"ext": ".png"
},
{
"name": "dot",
"url": "//yun.duiba.com.cn/aurora/assets/163e0fe5b25b81c9d3d1733b24dc5a52dce166f0.png",
"uuid": "dot",
"ext": ".png"
}
],
"events": {
"in": {
"game-mousedown": {
"alias": "按下",
"data": {
}
},
"game-mouseup": {
"alias": "松手发射",
"data": {
}
},
"game-reset": {
"alias": "重置游戏",
"data": {
}
},
"game-init": {
"alias": "初始化游戏",
"data": {
}
}
},
"out": {
"game-over": {
"alias": "落球完毕",
"data": {
}
}
}
}
}
\ No newline at end of file
import configData from "./configData";
import { getTextureByName } from "./utils";
export default class Ball extends engine.Image {
constructor() {
super();
this.texture = getTextureByName("ball");
this.anchorX = 24;
this.anchorY = 24;
}
movetime;
vx;
vy;
//减速上升
ltime1;
//曲线发射
ltime2;
//曲线到第一次碰撞
ltime3;
//阶段3弹球轨迹
linesarr = [];
//初始能量大小,判断第一个落点,5个等级
//第三阶段移动路径
lines = [];
//本次中奖prize
prizeid;
startmove(propower,prizeid) {
let time1 = configData.time1;
this.prizeid = prizeid;
engine.Tween.removeTweens(this);
engine.Tween.get(this)
.to({
y: 490
}, time1, engine.Ease.quadOut)
.call(() => {
this.movetime = 0;
this.vx = 0;
this.vy = (configData.maxspeed-configData.minspeed)*propower+configData.minspeed;
this.lines = configData.getLines(this.vy,this.prizeid);
console.error("选中的路径====》",this.lines);
console.error("检查233",propower,prizeid);
this.ltime1 = configData.get1v2c(configData.g/2,this.vy,340);
this.lastframetime = Date.now();
this.addEventListener(engine.Event.ENTER_FRAME, this.updategame, this);
// console.log(333333);
})
}
lastframetime: number = Date.now();
g2:number;
lt2:number = 0;
g3:number;
thirline:Array<any>;
updategame() {
// console.log(333333);
let ntime = Date.now();
let passtime = ntime - this.lastframetime;
//发射上升阶段
let movet1=0;
//发射曲线射出阶段
let movet2=0;
//加速度
let g = configData.g;
let npx = this.x;
let npy = this.y;
//阶段1移动
if(this.movetime<this.ltime1){
if(this.movetime+passtime>this.ltime1){
movet1 = this.ltime1-this.movetime;
passtime -= movet1;
}else{
movet1 = passtime;
passtime = -1;
}
this.movetime += movet1;
npy += this.vy*movet1+g*movet1*movet1/2;
npx += this.vx*movet1;
this.vy += g*movet1;
if(passtime>0){
let ltime2 = Math.floor(-140*2/this.vy);
this.ltime2 = ltime2+this.ltime1;
this.g2 = -this.vy/ltime2;
// console.log(this.vy+ltime2*this.g2);
console.error("第二阶段====",this.ltime2,this.movetime,this.ltime1,this.vy,this.vx,this.g2,ltime2);
}
}
//阶段2移动
if(passtime>0){
if(this.movetime<this.ltime2){
if(this.movetime+passtime>this.ltime2){
movet2 = this.ltime2-this.movetime;
passtime -= movet2;
}else{
movet2 = passtime;
passtime = -1;
}
this.lt2 += movet2;
this.movetime += movet2;
let chay = this.vy*movet2+this.g2*movet2*movet2/2;
let chax = this.vx*movet2-this.g2*movet2*movet2/2;
npy += chay;
npx += chax;
this.vx -= this.g2*movet2;
this.vy += this.g2*movet2;
if(passtime>0){
console.error("曲线运动结束==",this.vx,this.vy,this.movetime,this.lt2);
//阶段3开始
let maxlx = configData.dotsarr.line1[0][0]-npx;
let movey = configData.dotsarr.line1[0][1]-npy;
let g3 = configData.g*100;
let ltime3 = Math.ceil(Math.sqrt(2*movey/g3));
this.ltime3 = ltime3+this.ltime2;
// console.log("第三阶段",ltime3);
this.g3 = g3;
engine.globalEvent.dispatchEvent("fall-ball");
this.TweenMoveThir();
this.overmove();
return;
/**
* maxlx = configData.
* vx*t<=
*/
}
}
}
//阶段3移动
if(passtime>0){
// console.log(333333);
console.error("曲线运动结束233");
engine.globalEvent.dispatchEvent("fall-ball");
this.TweenMoveThir();
this.overmove();
}
this.x = npx;
this.y = npy;
this.lastframetime = ntime;
}
TweenMoveThir(){
let nx = this.x;
let ny = this.y;
let linepos = [];
let ballwid = 48;
let dotwid = 20;
engine.Tween.removeTweens(this);
for(let i=this.lines.length-1;i>-1;i--){
let idotinfo = this.lines[i];
let inline = idotinfo[0];
let inidx = idotinfo[1];
let inlor = idotinfo[2];
let indot = configData.dotsarr[inline][inidx];
let indotx = indot[0];
let indoty = indot[1];
let tpos1;
//弹射弹球
if(inlor==0){
tpos1 = [indotx-ballwid,indoty+dotwid/2-ballwid/2];
}else{
tpos1 = [indotx+dotwid,indoty+dotwid/2-ballwid/2];
}
let chax = nx-tpos1[0];
let chay = ny-tpos1[1];
//掉落弹球
if(chax<30){
// chax
}
linepos.push(tpos1);
}
// linepos.push()
let time1 = 0;
let twmove = engine.Tween.get(this);
for(let m=0;m<linepos.length;m++){
let mpos = linepos[m];
let mposx = mpos[0];
let mposy = mpos[1];
let lengx = nx-mposx;
let lengy = ny-mposy;
nx = mposx;
ny = mposy;
let lengt = Math.ceil(Math.sqrt(lengx*lengx+lengy*lengy)/0.8);
// console.log("位移233=========》",lengt);
// if(m==0){
// lengt=500;
// }
twmove
// .wait(time1)
.to({
x:mposx,
y:mposy
},lengt);
time1 += lengt;
if(m==linepos.length-1){
let finaposx = configData.prizePos[this.prizeid][0]-ballwid/2;
let finaposy = configData.prizePos[this.prizeid][1]-ballwid;
let finalengx = nx-finaposx;
let finalengy = ny-finaposy;
let finat = Math.ceil(Math.sqrt(finalengx*finalengx+finalengy*finalengy)/0.8);
twmove.to({
x:finaposx,
y:finaposy
},finat);
twmove.call(()=>{
engine.globalEvent.dispatchEvent("game-over");
})
}
}
}
overmove() {
this.removeEventListener(engine.Event.ENTER_FRAME, this.updategame, this);
}
}
\ No newline at end of file
import { props } from "../props";
import { getTextureByName } from "./utils";
import Ball from "./Ball";
import configData from "./configData";
export default class GameView extends engine.Container {
constructor() {
super();
this.once(engine.Event.ADDED_TO_STAGE, this.setup, this);
}
ball: engine.Image;
ballfire: Ball;
cuizi: engine.Image;
prizetxt1: engine.Label;
prizetxt2: engine.Label;
prizetxt3: engine.Label;
prizetxt4: engine.Label;
prizetxt5: engine.Label;
prizetxt6: engine.Label;
prizetxt7: engine.Label;
inemit = false;
setup() {
configData.initDotInfo();
let gamebg = new engine.Image(getTextureByName("gamebg"));
this.addChild(gamebg);
this.cuizi = new engine.Image(getTextureByName("cuizi"));
this.cuizi.x = 549;
this.cuizi.y = 565;
this.addChild(this.cuizi);
//圆点层
let dotcont = new engine.Container();
this.addChild(dotcont);
let dotarr = configData.dotsarr;
let dotexture = getTextureByName("dot");
// for (let k in dotarr) {
// let kdot = dotarr[k];
// for (let d = 0; d < kdot.length; d++) {
// let dpos = kdot[d];
// let idot = new engine.Image(dotexture);
// idot.x = dpos[0];
// idot.y = dpos[1];
// dotcont.addChild(idot);
// let txt = new engine.Label();
// txt.size = 20;
// txt.text = k.slice(-1) + "|" + d;
// idot.addChild(txt);
// }
// }
//七个奖品文本
for (let i = 1; i < 8; i++) {
let itext = new engine.Label();
itext.width = 56;
itext.size = 22;
itext.fillColor = "#660000";
// itext.bold = true;
itext.textAlign = engine.TEXT_ALIGN.CENTER;
itext.lineType = engine.TEXT_lINETYPE.MULTI;
itext.text = "奖品" + i;
itext.x = 20 + (56 + 16) * (i - 1);
itext.y = 516;
this.addChild(itext);
this["prizetxt" + i] = itext;
}
let cuizimask = new engine.Graphics();
cuizimask.beginFill(0xffffff, 1);
cuizimask.drawRect(549, 530, 42, 62);
cuizimask.endFill();
this.addChild(cuizimask);
this.cuizi.mask = cuizimask;
this.ball = new engine.Image(getTextureByName("ball"));
this.ball.anchorX = 24;
this.ball.anchorY = 24;
this.addChild(this.ball);
let ballmask = new engine.Graphics();
ballmask.beginFill(0xffffff, 1);
ballmask.drawRect(550, 352, 64, 250);
ballmask.endFill();
this.addChild(ballmask);
this.ball.mask = ballmask;
this.ballfire = new Ball();
this.addChild(this.ballfire);
this.ballfire.visible = false;
let topimg = new engine.Image(getTextureByName("topimg"));
this.addChild(topimg);
this.removeEventListener(engine.Event.ADDED_TO_STAGE, this.setup, this);
this.reset();
//testbtn
// let testbtn = new engine.Label();
// testbtn.text = "发射";
// testbtn.size = 77;
// testbtn.fillColor = "#ff0000";
// this.addChild(testbtn);
// testbtn.y = 800;
// testbtn.x = 100;
// testbtn.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.mousedown, this);
// testbtn.addEventListener(engine.MouseEvent.MOUSE_UP,this.mouseup,this);
engine.globalEvent.addEventListener("fall-ball", this.fallBall, this);
}
mousedown() {
}
mouseup(propower = 1, prizeid = 2) {
if (!this.inemit) {
this.inemit = true;
// console.log("发射233========");
//
this.ballfire.x = 550;
this.ballfire.y = 520;
this.ballfire.visible = true;
this.ball.visible = false;
this.ballfire.startmove(propower, prizeid);
engine.Tween.removeTweens(this.cuizi);
let time1 = configData.time1;
let time2 = configData.time2;
let time3 = configData.time3;
engine.Tween.get(this.cuizi)
.to({
y: 535
}, time1, engine.Ease.quadOut)
.to({
y: 565
}, time2, engine.Ease.quadIn)
.call(() => {
this.inemit = false;
})
}
}
noemit() {
this.ballfire.visible = false;
this.ball.x = 550;
this.ball.y = 520;
this.ball.visible = true;
engine.Tween.removeTweens(this.cuizi);
engine.Tween.removeTweens(this.ball);
let time1 = configData.time1;
let time2 = configData.time2;
let time3 = configData.time3;
engine.Tween.get(this.cuizi)
.to({
y: 535
}, time1, engine.Ease.quadOut)
.to({
y: 565
}, time2, engine.Ease.quadIn)
.call(() => {
this.inemit = false;
})
engine.Tween.get(this.ball)
.to({
y: 460
}, time1+300, engine.Ease.quadOut)
.to({
y:520
},time1+300,engine.Ease.quadIn)
.call(()=>{
console.error("球落完毕==自定义======2333");
engine.globalEvent.dispatchEvent("fall-complete");
})
}
reset() {
this.ball.x = 550;
this.ball.y = 520;
}
init() {
// console.log("initData=========>",props);
let prizedata = props.prizedata;
for (let i = 0; i < prizedata.length; i++) {
let idata = prizedata[i];
this["prizetxt" + (i + 1)].text = idata;
}
}
//球掉落
fallBall() {
console.log("球掉落=========》");
this.ball.visible = true;
this.ball.x = 500;
this.ball.y = 352;
engine.Tween.removeTweens(this.ball);
engine.Tween.get(this.ball)
.to({
x: 550
}, 300, engine.Ease.sineOut);
engine.Tween.get(this.ball)
.to({
y: 520
}, 300, engine.Ease.sineIn)
// .to({
// y:520
// },100);
}
}
\ No newline at end of file
import { injectProps} from "../props";
/**
* Created by rockyl on 2020-01-09.
*/
import GameView from "./GameView"
export class GameWrapper extends engine.Container {
private _gameView: GameView;
constructor() {
super();
engine.globalEvent.addEventListener('game-mousedown', this.mousedown, this);
engine.globalEvent.addEventListener('game-mouseup', this.mouseup, this);
engine.globalEvent.addEventListener('game-reset', this.reset, this);
engine.globalEvent.addEventListener('game-init', this.init, this);
engine.globalEvent.addEventListener('game-noemit',this.noemit,this);
this._gameView = new GameView();
this.addChild(this._gameView);
}
mousedown(){
this._gameView.mousedown();
}
mouseup(event){
let data = event.data;
let propower = data.propower;
let prizeid = data.prizeid;
this._gameView.mouseup(propower,prizeid);
}
reset(){
this._gameView.reset();
}
init(event){
injectProps(event.data);
this._gameView.init();
}
noemit(){
this._gameView.noemit();
}
}
This diff is collapsed.
/**
* Created by rockyl on 2020-01-21.
*/
export function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
export function getTextureByName(name) {
// console.log("资源加载",name);
return getTexture(engine.getAssetByName(name).uuid);
}
export function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function getStage(){
return engine.gameStage.stage;
}
export function createSvga(name) {
let inst = new svga.Svga();
inst.source = engine.getAssetByName(name).uuid;
// let anchor = props[(anchorName)];
// if (anchor) {
// inst.x = -anchor.x;
// inst.y = -anchor.y;
// inst.anchorX = anchor.x;
// inst.anchorY = anchor.y;
// }
return inst;
}
/**
* Created by rockyl on 2019-11-20.
*/
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.
*/
// "//yun.duiba.com.cn/aurora/assets/21070d5b302402f69b9019616c647097961fd3ab.png",
////yun.duiba.com.cn/aurora/assets/17de7d5e4daca9634861c9b89bc41022df52c4a4.png
export let props: any = {};
export function prepareProps() {
let metaProps = getProps();
engine.injectProp(props, metaProps);
}
export function injectProps(p) {
engine.injectProp(props, p);
}
......@@ -28,7 +28,7 @@
return engine.getAssetByName(props.blockHitAssets[type]);
}
function createSvga(name, anchorName) {
var inst = new svga.Svga();
var inst = new svga.Svga();
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
var anchor = props[(anchorName)];
if (anchor) {
......@@ -81,6 +81,7 @@
this.bodyProfect.gotoAndStop(1);
this.body.visible = true;
this.bodyHit.visible = false;
console.log("block==svga==", this.body, this.bodyHit);
};
Block.prototype.playEnter = function (index, animation) {
var _this = this;
......@@ -166,6 +167,7 @@
};
return Background;
}(engine.Container));
//# sourceMappingURL=Background.js.map
var svgaAssets = {
aniReady: { name: '准备立正', dir: 1 },
......@@ -526,6 +528,7 @@
return new Promise(function (resolve) {
_this._jumpTipsLabel.text = props.jumpTips[parseInt((Math.random() * props.jumpTips.length) + "")];
_this.alpha = 1;
console.log("text233======", _this._jumpTipsLabel.text, _this.x, _this.y);
engine.Tween.get(_this, null, null, true)
.wait(800)
.to({ alpha: 0 }, 200, engine.Ease.cubicInOut)
......@@ -534,7 +537,6 @@
};
return JumpTips;
}(engine.Container));
//# sourceMappingURL=JumpTips.js.map
var ObjectPool = engine.ObjectPool;
var PoolName = 'gold-bag';
......@@ -576,6 +578,7 @@
blockShadow.x = -(blockShadow.width - base.width) / 2;
blockShadow.y = props.blockShadowOffset;
base.addChild(blockShadow);
console.log("testbase===", base);
var blockContainer = this.blockContainer = new engine.Container();
frontContainer.addChild(blockContainer);
var player = this.player = new Player();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -62,6 +62,7 @@ export default class Block extends engine.Container {
this.body.visible=true;
this.bodyHit.visible=false;
console.log("block==svga==",this.body,this.bodyHit);
}
playEnter(index, animation) {
......
......@@ -89,7 +89,7 @@ export default class GameView extends engine.Container {
blockShadow.y =props.blockShadowOffset;
base.addChild(blockShadow);
console.log("testbase===",base);
const blockContainer = this.blockContainer = new engine.Container();
frontContainer.addChild(blockContainer);
......
......@@ -50,6 +50,7 @@ export class JumpTips extends engine.Container {
return new Promise(resolve => {
this._jumpTipsLabel.text=props.jumpTips[parseInt((Math.random()*props.jumpTips.length)+"")]
this.alpha=1;
console.log("text233======",this._jumpTipsLabel.text,this.x,this.y);
engine.Tween.get(this, null, null, true)
.wait(800)
.to({alpha: 0}, 200, engine.Ease.cubicInOut)
......
This diff is collapsed.
This diff is collapsed.
......@@ -104,6 +104,11 @@ export default class Game {
console.error("destroy===233");
}
}
//游戏结束,清场
public clearGame(){
//子弹层
// this.layers.bullet
}
private mgrs: GameMgr[] = [];
public _phycicsSystem: PhycicsSystem = new PhycicsSystem();
......
......@@ -7,7 +7,7 @@ export default class GameObject extends engine.Container {
public name: string = "";
public addComponent<T extends GameComponent>(cls: any): T {
if (this.getComponent(cls) != null) {
console.error("component is existent");
// console.error("component is existent");
return;
}
let ins = new cls(this);
......
......@@ -35,7 +35,7 @@ export default class GuideMask extends engine.Container {
top.endFill();
this.addChild(top);
console.log("长短配置1",sw,sh,y,x,mask.height);
// console.log("长短配置1",sw,sh,y,x,mask.height);
let bottom = new engine.Shape();
bottom.beginFill(color, alpha);
......
......@@ -25,12 +25,12 @@ export class ShootPlanet extends engine.Container {
engine.globalEvent.addEventListener("bqgame-start",this.onStart,this);
engine.globalEvent.addEventListener("bqgame_reset",this.onReset,this);
// this.testbtn = new engine.Shape();
// this.testbtn.beginFill(0xff0000,1);
// this.testbtn.drawRect(0,0,200,200);
// this.testbtn.endFill();
// this.addChild(this.testbtn);
// this.testbtn.addEventListener(engine.MouseEvent.CLICK,this.changeStage,this);
this.testbtn = new engine.Shape();
this.testbtn.beginFill(0xff0000,1);
this.testbtn.drawRect(0,0,200,200);
this.testbtn.endFill();
this.addChild(this.testbtn);
this.testbtn.addEventListener(engine.MouseEvent.CLICK,this.changeStage,this);
}
//stage测试233
ntype = "bqgame-create";
......@@ -46,10 +46,10 @@ export class ShootPlanet extends engine.Container {
public onActive() {
if(!this.game){
console.error("新建game========");
// console.error("新建game========");
this.game = new Game(this);
}
// this.setChildIndex(this.testbtn,100);
this.setChildIndex(this.testbtn,100);
// if (GuideMgr.instance.guideFlag == true) {
// const car = this.game._car;
// GuideMgr.instance.runGuide(0, car.x + car.width / 2, car.y + car.height / 2 /* - 130 */);
......@@ -63,11 +63,14 @@ export class ShootPlanet extends engine.Container {
this.game.destroy();
this.game = null;
}
public clearGame(){
this.game.clearGame();
}
public onStart(e){
if(e.data){
let guide = e.data.guide;
console.log("guide",guide);
// console.log("guide",guide);
if(guide){
const car = this.game._car;
GuideMgr.instance.runGuide(0, Math.floor(car.x + car.width / 2), Math.floor(car.y + car.height / 2-110) /* - 130 */);
......
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