Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔立强
db-game-template
Commits
bf7a0a2f
Commit
bf7a0a2f
authored
Feb 20, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
94b09e6e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
39 deletions
+44
-39
index.html
egret/index.html
+8
-6
RankPanel.ts
egret/libs/new_wx/components/RankPanel.ts
+32
-32
PlayScene.ts
egret/src/playScene/PlayScene.ts
+1
-1
blockGen.ts
egret/src/playScene/blockGen.ts
+2
-0
createSpeialCircle.ts
egret/src/playScene/factory/createSpeialCircle.ts
+1
-0
No files found.
egret/index.html
View file @
bf7a0a2f
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
Egret
</title>
<title>
Egret
</title>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
<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=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
...
@@ -28,9 +29,10 @@
...
@@ -28,9 +29,10 @@
</head>
</head>
<body>
<body>
<div
style=
"margin: auto;width: 100%;height: 100%;"
class=
"egret-player"
data-entry-class=
"Main"
data-orientation=
"auto"
<div
style=
"margin: auto;width: 100%;height: 100%;"
class=
"egret-player"
data-entry-class=
"Main"
data-scale-mode=
"showAll"
data-frame-rate=
"60"
data-content-width=
"750"
data-content-height=
"1624"
data-orientation=
"auto"
data-scale-mode=
"showAll"
data-frame-rate=
"60"
data-content-width=
"750"
data-multi-fingered=
"2"
data-show-fps=
"false"
data-show-log=
"false"
data-show-fps-style=
"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"
>
data-content-height=
"1624"
data-multi-fingered=
"2"
data-show-fps=
"false"
data-show-log=
"false"
data-show-fps-style=
"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"
>
</div>
</div>
<script
src=
"libs/modules/egret/egret.js"
></script>
<script
src=
"libs/modules/egret/egret.js"
></script>
...
@@ -42,9 +44,9 @@
...
@@ -42,9 +44,9 @@
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script>
<script>
window
[
'numsP'
]
=
10
;
window
[
'numsP'
]
=
.
01
;
// window['debugPhysics']=true;
// window['debugPhysics']=true;
window
[
'renderMode'
]
=
'webgl'
;
window
[
'renderMode'
]
=
'webgl'
;
window
[
'development'
]
=
true
;
window
[
'development'
]
=
true
;
var
gameId
=
1
;
var
gameId
=
1
;
var
CFG
=
{
var
CFG
=
{
...
...
egret/libs/new_wx/components/RankPanel.ts
View file @
bf7a0a2f
...
@@ -4,52 +4,52 @@ import { NetManager } from "../../tw/manager/NetManager";
...
@@ -4,52 +4,52 @@ import { NetManager } from "../../tw/manager/NetManager";
import
RankItem
from
"./RankItem"
;
import
RankItem
from
"./RankItem"
;
export
default
class
RankPanel
extends
Panel
{
export
default
class
RankPanel
extends
Panel
{
public
ruleBg
:
eui
.
Image
;
public
ruleBg
:
eui
.
Image
;
public
closeBtn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
public
scroller
:
eui
.
Scroller
;
public
scroller
:
eui
.
Scroller
;
public
group
:
eui
.
Group
;
public
group
:
eui
.
Group
;
public
list
:
eui
.
List
;
public
list
:
eui
.
List
;
public
title
:
eui
.
Image
;
public
title
:
eui
.
Image
;
public
dog
:
eui
.
Image
;
public
dog
:
eui
.
Image
;
public
rankNum
:
eui
.
Label
;
public
rankNum
:
eui
.
Label
;
public
userIdtxt
:
eui
.
Label
;
public
userIdtxt
:
eui
.
Label
;
public
scoretxt
:
eui
.
Label
;
public
scoretxt
:
eui
.
Label
;
public
userItemBg
:
eui
.
Image
;
public
userItemBg
:
eui
.
Image
;
public
userRankNum
:
eui
.
Label
;
public
userRankNum
:
eui
.
Label
;
public
userId
:
eui
.
Label
;
public
userId
:
eui
.
Label
;
public
userScore
:
eui
.
Label
;
public
userScore
:
eui
.
Label
;
public
num3
:
eui
.
Image
;
public
num3
:
eui
.
Image
;
public
num2
:
eui
.
Image
;
public
num2
:
eui
.
Image
;
public
num1
:
eui
.
Image
;
public
num1
:
eui
.
Image
;
async
start
()
{
async
start
()
{
super
.
start
();
super
.
start
();
if
(
!
DataManager
.
ins
.
realTimeRankData
)
//
if (!DataManager.ins.realTimeRankData)
NetManager
.
ins
.
realtimerank
((
success
:
boolean
)
=>
{
NetManager
.
ins
.
realtimerank
((
success
:
boolean
)
=>
{
if
(
success
)
{
if
(
success
)
{
this
.
updatePanel
();
this
.
updatePanel
();
}
}
},
0
);
},
0
);
else
//
else
this
.
updatePanel
();
//
this.updatePanel();
}
}
updatePanel
()
{
updatePanel
()
{
if
(
DataManager
.
ins
.
realTimeRankData
&&
DataManager
.
ins
.
realTimeRankData
.
myUserData
)
{
if
(
DataManager
.
ins
.
realTimeRankData
&&
DataManager
.
ins
.
realTimeRankData
.
myUserData
)
{
this
.
userId
.
text
=
`我`
;
this
.
userId
.
text
=
`我`
;
this
.
userRankNum
.
text
=
DataManager
.
ins
.
realTimeRankData
.
myUserData
&&
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
rank
?
`
${
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
rank
}
`
:
'未上榜'
;
this
.
userRankNum
.
text
=
DataManager
.
ins
.
realTimeRankData
.
myUserData
&&
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
rank
?
`
${
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
rank
}
`
:
'未上榜'
;
this
.
userScore
.
text
=
DataManager
.
ins
.
realTimeRankData
.
myUserData
&&
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
maxScore
?
`
${
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
maxScore
}
`
:
'暂无分数'
;
this
.
userScore
.
text
=
DataManager
.
ins
.
realTimeRankData
.
myUserData
&&
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
maxScore
?
`
${
DataManager
.
ins
.
realTimeRankData
.
myUserData
.
maxScore
}
`
:
'暂无分数'
;
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
itemRenderer
=
RankItem
;
this
.
list
.
itemRenderer
=
RankItem
;
const
ac
=
new
eui
.
ArrayCollection
(
DataManager
.
ins
.
realTimeRankData
.
userList
);
const
ac
=
new
eui
.
ArrayCollection
(
DataManager
.
ins
.
realTimeRankData
.
userList
);
this
.
list
.
dataProvider
=
ac
;
this
.
list
.
dataProvider
=
ac
;
}
else
{
}
else
{
this
.
userId
.
text
=
`我`
;
this
.
userId
.
text
=
`我`
;
this
.
userRankNum
.
text
=
`未上榜`
;
this
.
userRankNum
.
text
=
`未上榜`
;
this
.
userScore
.
text
=
`暂无分数`
;
this
.
userScore
.
text
=
`暂无分数`
;
if
(
DataManager
.
ins
.
realTimeRankData
.
userList
)
{
if
(
DataManager
.
ins
.
realTimeRankData
.
userList
)
{
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
itemRenderer
=
RankItem
;
this
.
list
.
itemRenderer
=
RankItem
;
const
ac
=
new
eui
.
ArrayCollection
(
DataManager
.
ins
.
realTimeRankData
.
userList
);
const
ac
=
new
eui
.
ArrayCollection
(
DataManager
.
ins
.
realTimeRankData
.
userList
);
...
@@ -59,5 +59,5 @@ export default class RankPanel extends Panel {
...
@@ -59,5 +59,5 @@ export default class RankPanel extends Panel {
}
}
get
skinKey
()
{
return
'Rank'
}
get
skinKey
()
{
return
'Rank'
}
}
}
\ No newline at end of file
egret/src/playScene/PlayScene.ts
View file @
bf7a0a2f
...
@@ -60,7 +60,7 @@ export default class PlayScene extends Scene {
...
@@ -60,7 +60,7 @@ export default class PlayScene extends Scene {
private
timeSpeed
=
1
;
private
timeSpeed
=
1
;
/** 初始的球数 */
/** 初始的球数 */
private
INIT_BALL_NUMS
=
1
;
private
INIT_BALL_NUMS
=
window
[
'INIT_BALL_NUMS'
]
;
/** 当前的球列表 */
/** 当前的球列表 */
private
balls
:
Ball
[]
=
[];
private
balls
:
Ball
[]
=
[];
/** 对象池 */
/** 对象池 */
...
...
egret/src/playScene/blockGen.ts
View file @
bf7a0a2f
...
@@ -54,6 +54,8 @@ export const getBlocks = (currBallNums: number) => {
...
@@ -54,6 +54,8 @@ export const getBlocks = (currBallNums: number) => {
if
(
Math
.
random
()
<
0.3
&&
j
<
specialNumBlocksNums
)
{
if
(
Math
.
random
()
<
0.3
&&
j
<
specialNumBlocksNums
)
{
nums
=
getNums2
(
currBallNums
);
nums
=
getNums2
(
currBallNums
);
}
}
if
(
currBallNums
>=
50
)
nums
=
getNums2
(
currBallNums
);
blocksInfo
.
push
({
blocksInfo
.
push
({
position
:
p
,
position
:
p
,
type
:
getBlockShape
(),
type
:
getBlockShape
(),
...
...
egret/src/playScene/factory/createSpeialCircle.ts
View file @
bf7a0a2f
...
@@ -30,4 +30,5 @@ export default (that: PlayScene, x, y, num) => {
...
@@ -30,4 +30,5 @@ export default (that: PlayScene, x, y, num) => {
block
.
y
=
y
;
block
.
y
=
y
;
block
.
num
=
num
;
block
.
num
=
num
;
that
.
blocks
.
push
(
block
);
that
.
blocks
.
push
(
block
);
block
.
ladderNums
=
1
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment