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
522e87d9
Commit
522e87d9
authored
Dec 19, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f5f93e3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
29 deletions
+46
-29
index.html
egret/index.html
+3
-3
RotatePanel.ts
egret/libs/new_wx/components/RotatePanel.ts
+15
-12
SlotPanel.ts
egret/libs/new_wx/components/SlotPanel.ts
+28
-14
No files found.
egret/index.html
View file @
522e87d9
...
@@ -45,9 +45,9 @@
...
@@ -45,9 +45,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>
//
localStorage.clear();
localStorage
.
clear
();
//
localStorage.setItem('currentLevel','5');
localStorage
.
setItem
(
'currentLevel'
,
'5'
);
// localStorage.setItem('currentScore','0
');
localStorage
.
setItem
(
'currentScore'
,
'9
'
);
window
[
'development'
]
=
true
;
window
[
'development'
]
=
true
;
var
gameId
=
1
;
var
gameId
=
1
;
var
CFG
=
{
var
CFG
=
{
...
...
egret/libs/new_wx/components/RotatePanel.ts
View file @
522e87d9
...
@@ -36,23 +36,26 @@ export default class RotatePannel extends Panel {
...
@@ -36,23 +36,26 @@ export default class RotatePannel extends Panel {
if
(
!
this
.
check
())
return
;
if
(
!
this
.
check
())
return
;
this
.
closeBtns
.
forEach
(
btn
=>
btn
.
touchEnabled
=
false
);
this
.
closeBtns
.
forEach
(
btn
=>
btn
.
touchEnabled
=
false
);
this
[
'rotateStart'
].
touchEnabled
=
false
;
this
[
'rotateStart'
].
touchEnabled
=
false
;
this
.
showAnimation
(
3000
,
720
,
false
,
egret
.
Ease
.
sineIn
,
null
)
this
.
showAnimation
(
3000
,
720
*
4
,
false
,
egret
.
Ease
.
sineIn
,
null
)
submitAfterDostart
((
status
,
data
)
=>
{
submitAfterDostart
((
status
,
data
)
=>
{
let
prizeName
=
data
.
lottery
?
data
.
lottery
.
name
:
''
let
prizeName
=
data
.
lottery
?
data
.
lottery
.
name
:
''
this
.
prizeIndex
=
this
.
optionList
.
findIndex
(
item
=>
item
.
name
===
prizeName
)
this
.
prizeIndex
=
this
.
optionList
.
findIndex
(
item
=>
item
.
name
===
prizeName
)
let
deg
=
this
.
prizeIndex
>
-
1
?
180
-
this
.
prizeIndex
*
45
:
-
22.5
let
deg
=
this
.
prizeIndex
>
-
1
?
180
-
this
.
prizeIndex
*
45
:
-
22.5
this
.
showAnimation
(
4000
,
1080
+
deg
,
false
,
egret
.
Ease
.
sineOut
,
()
=>
{
this
.
showAnimation
(
3000
,
720
*
4
,
false
,
egret
.
Ease
.
sineOut
,
()
=>
{
wait
(
300
).
then
(()
=>
{
if
(
gameIsWinning
())
{
});
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
);
}
else
{
wait
(
1000
).
then
(()
=>
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_PRIZE_PANEL
);
if
(
gameIsWinning
())
{
}
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
);
});
}
else
{
wait
(
300
).
then
(()
=>
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_PRIZE_PANEL
);
NetManager
.
ins
.
getInfo
()
}
});
});
wait
(
300
).
then
(()
=>
{
NetManager
.
ins
.
getInfo
()
});
});
},
30
);
},
30
);
}
}
...
...
egret/libs/new_wx/components/SlotPanel.ts
View file @
522e87d9
...
@@ -32,7 +32,7 @@ export default class SlotPanel extends Panel {
...
@@ -32,7 +32,7 @@ export default class SlotPanel extends Panel {
this
.
speed
=
1
this
.
speed
=
1
this
.
dis
=
0
this
.
dis
=
0
this
.
N
=
2
this
.
N
=
2
this
.
INITALSPEED
=
3
0
this
.
INITALSPEED
=
7
0
if
(
!
DataManager
.
ins
.
getOptionsData
)
if
(
!
DataManager
.
ins
.
getOptionsData
)
NetManager
.
ins
.
getOptions
(()
=>
{
NetManager
.
ins
.
getOptions
(()
=>
{
this
.
initSlot
()
this
.
initSlot
()
...
@@ -75,17 +75,17 @@ export default class SlotPanel extends Panel {
...
@@ -75,17 +75,17 @@ export default class SlotPanel extends Panel {
this
.
dis
=
this
.
Do
this
.
dis
=
this
.
Do
this
.
speed
=
0
this
.
speed
=
0
egret
.
stopTick
(
this
.
onTick
,
this
);
egret
.
stopTick
(
this
.
onTick
,
this
);
wait
(
500
).
then
(()
=>
{
//
wait(500).then(() => {
if
(
gameIsWinning
())
{
//
if (gameIsWinning()) {
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
);
//
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
}
else
{
//
} else {
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_PRIZE_PANEL
);
//
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
}
//
}
});
//
});
wait
(
300
).
then
(()
=>
{
//
wait(300).then(() => {
NetManager
.
ins
.
getInfo
()
//
NetManager.ins.getInfo()
// this.gameReset()
//
// this.gameReset()
});
//
});
return
return
}
}
this
.
speed
=
(
1
-
this
.
dis
/
this
.
Do
)
*
this
.
INITALSPEED
this
.
speed
=
(
1
-
this
.
dis
/
this
.
Do
)
*
this
.
INITALSPEED
...
@@ -99,7 +99,7 @@ export default class SlotPanel extends Panel {
...
@@ -99,7 +99,7 @@ export default class SlotPanel extends Panel {
if
(
!
this
.
check
())
return
;
if
(
!
this
.
check
())
return
;
this
.
closeBtns
.
forEach
(
btn
=>
btn
.
touchEnabled
=
false
);
this
.
closeBtns
.
forEach
(
btn
=>
btn
.
touchEnabled
=
false
);
this
[
'slotStartBtn'
].
touchEnabled
=
false
;
this
[
'slotStartBtn'
].
touchEnabled
=
false
;
this
.
calcSpeed
(
1
,
this
.
INITALSPEED
)
this
.
calcSpeed
(
1
0
,
this
.
INITALSPEED
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
stop
()
this
.
stop
()
})
})
...
@@ -127,11 +127,25 @@ export default class SlotPanel extends Panel {
...
@@ -127,11 +127,25 @@ export default class SlotPanel extends Panel {
stop
()
{
stop
()
{
submitAfterDostart
((
status
,
data
)
=>
{
submitAfterDostart
((
status
,
data
)
=>
{
let
prizeName
=
data
.
lottery
?
data
.
lottery
.
name
:
''
let
prizeName
=
data
.
lottery
?
data
.
lottery
.
name
:
''
wait
(
2
000
).
then
(()
=>
{
wait
(
1
000
).
then
(()
=>
{
let
hashIndex
=
this
.
optionList
.
findIndex
(
item
=>
item
.
name
===
prizeName
)
let
hashIndex
=
this
.
optionList
.
findIndex
(
item
=>
item
.
name
===
prizeName
)
this
.
prizeItem
=
this
.
itemList
[
hashIndex
]
this
.
prizeItem
=
this
.
itemList
[
hashIndex
]
this
.
Do
=
(
this
.
prizeItem
?
this
.
prizeItem
.
x
:
-
100
)
-
384
+
this
.
N
*
this
.
itemList
.
length
*
this
.
itemWidth
this
.
Do
=
(
this
.
prizeItem
?
this
.
prizeItem
.
x
:
-
100
)
-
384
+
this
.
N
*
this
.
itemList
.
length
*
this
.
itemWidth
wait
(
1
).
then
(()
=>
{
if
(
gameIsWinning
())
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PRIZE_PANEL
);
}
else
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NO_PRIZE_PANEL
);
}
});
wait
(
1
).
then
(()
=>
{
NetManager
.
ins
.
getInfo
()
// this.gameReset()
});
})
})
},
20
);
},
20
);
}
}
...
...
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