Commit e707eaf2 by Shawn Wang

loop and control boundery

parent 3f9c7cd9
......@@ -87,7 +87,20 @@ class Controller extends egret.Sprite {
delta.x += 1
}
let newX = this.myPosition.x + delta.x
let newY = this.myPosition.y + delta.y
if(newX < 0){
newX = 0
}
if(newY < 0){
newY = 0
}
if(newX >= 13){
newX = 13
}
if(newY >= 9){
newY = 9
}
platform.sendSocketMessage({
data: JSON.stringify({
......@@ -95,8 +108,8 @@ class Controller extends egret.Sprite {
room_id: 'default_room',
cid: Store.getState().cid,
payload: {
x: this.myPosition.x + delta.x,
y: this.myPosition.y + delta.y,
x: newX,
y: newY,
avatar_url: Store.getState().userInfo.avatarUrl,
nick_name: Store.getState().userInfo.nickName
}
......
......@@ -70,7 +70,7 @@ class Main extends egret.DisplayObjectContainer {
})
console.log(userInfo);
SoundManager.getInstance().play({soundName: "bgm_mp3"})
SoundManager.getInstance().play({soundName: "bgm_mp3", startTime: 0, loops: -1})
platform.onShareAppMessage((...args) => {
return {
title: "恶魔妈妈买面膜",
......
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