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
d7657c2d
Commit
d7657c2d
authored
Oct 10, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b1c28df0
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
54 additions
and
46 deletions
+54
-46
index.html
egret/index.html
+12
-10
alert_2.tmproject
egret/resource/TextureMerger/alert_2.tmproject
+1
-0
loading_1.tmproject
egret/resource/TextureMerger/loading_1.tmproject
+1
-0
msg_0.tmproject
egret/resource/TextureMerger/msg_0.tmproject
+1
-0
rule_3.tmproject
egret/resource/TextureMerger/rule_3.tmproject
+1
-0
default.res.json
egret/resource/default.res.json
+12
-16
Main.ts
egret/src/Main.ts
+0
-1
Box.ts
egret/src/startScene/Box.ts
+11
-0
BoxType.ts
egret/src/startScene/BoxType.ts
+0
-8
IBoxItem.ts
egret/src/startScene/IBoxItem.ts
+4
-0
StartScene.ts
egret/src/startScene/StartScene.ts
+11
-11
No files found.
egret/index.html
View file @
d7657c2d
...
...
@@ -42,16 +42,18 @@
<!-- <script src="default.thm.js"></script> -->
<script
src=
"output.js"
></script>
<script>
var
debug
=
1
;
var
moneyHandSize
=
40
;
var
boxmap
=
{
coin
:
0
,
gift
:
0
,
gift2
:
0
,
woodbox
:
1
,
//木宝箱
silverbox
:
3
,
//银宝箱
goldenbox
:
5
,
//金宝箱
};
var
debug
=
1
;
var
moneyHandSize
=
50
;
var
boxmap
=
{
coin
:
{
award
:
0
,
skin
:
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/coin.png'
},
gift
:
{
award
:
0
,
skin
:
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/gift.png'
},
gift2
:
{
award
:
0
,
skin
:
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/gift2.png'
},
woodbox
:
{
award
:
1
,
skin
:
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/woodbox.png'
},
//木宝箱
silverbox
:
{
award
:
3
,
skin
:
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/silverbox.png'
},
//银宝箱
goldenbox
:
{
award
:
5
,
skin
:
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/goldenbox.png'
},
//金宝箱
};
var
__bgUrl__
=
'https://yun.duiba.com.cn/db_games/activity/fishing/1539151820/resource/assets/startScene/bg.jpg'
;
var
gameId
=
1
;
var
CFG
=
{
...
...
egret/resource/TextureMerger/alert_2.tmproject
0 → 100644
View file @
d7657c2d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"alert_2","version":5,"files":["../assets/alert/Bitmap-4.png","../assets/alert/Bitmap-2.png","../assets/alert/Bitmap-1.png"]}
\ No newline at end of file
egret/resource/TextureMerger/loading_1.tmproject
0 → 100644
View file @
d7657c2d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"loading_1","version":5,"files":["../assets/loading/bg.png","../assets/loading/progress.png"]}
\ No newline at end of file
egret/resource/TextureMerger/msg_0.tmproject
0 → 100644
View file @
d7657c2d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"msg_0","version":5,"files":["../assets/msg/msgBg.png","../assets/msg/x.png","../assets/msg/sureBtn.png"]}
\ No newline at end of file
egret/resource/TextureMerger/rule_3.tmproject
0 → 100644
View file @
d7657c2d
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_3","version":5,"files":["../assets/rule/ruleBg.png","../assets/rule/X.png"]}
\ No newline at end of file
egret/resource/default.res.json
View file @
d7657c2d
...
...
@@ -15,10 +15,6 @@
{
"keys"
:
"ruleBg_png,X_png"
,
"name"
:
"rule"
},
{
"name"
:
"preload"
,
"keys"
:
"gift2_png,coin_png,gift_png,goldenbox_png,silverbox_png,woodbox_png"
}
],
"resources"
:
[
...
...
@@ -78,34 +74,34 @@
"name"
:
"bg_jpg"
},
{
"
name"
:
"gift2_
png"
,
"
url"
:
"assets/startScene/gift2.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/startScene/gift2.
png"
"
name"
:
"gift2_
png"
},
{
"
name"
:
"coin_
png"
,
"
url"
:
"assets/startScene/coin.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/startScene/coin.
png"
"
name"
:
"coin_
png"
},
{
"
name"
:
"gift_
png"
,
"
url"
:
"assets/startScene/gift.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/startScene/gift.
png"
"
name"
:
"gift_
png"
},
{
"
name"
:
"goldenbox_
png"
,
"
url"
:
"assets/startScene/goldenbox.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/startScene/goldenbox.
png"
"
name"
:
"goldenbox_
png"
},
{
"
name"
:
"silverbox_
png"
,
"
url"
:
"assets/startScene/silverbox.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/startScene/silverbox.
png"
"
name"
:
"silverbox_
png"
},
{
"
name"
:
"woodbox_
png"
,
"
url"
:
"assets/startScene/woodbox.
png"
,
"type"
:
"image"
,
"
url"
:
"assets/startScene/woodbox.
png"
"
name"
:
"woodbox_
png"
}
]
}
\ No newline at end of file
egret/src/Main.ts
View file @
d7657c2d
...
...
@@ -14,7 +14,6 @@ class Main extends MainBase {
}
protected
async
createGameScene
()
{
// await RES.getResAsync('bg_jpg');
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
);
}
}
...
...
egret/src/startScene/Box.ts
View file @
d7657c2d
...
...
@@ -21,4 +21,15 @@ export default class Box extends egret.Sprite {
}
get
type
()
{
return
this
.
_type
}
static
getBoxList
()
{
const
list
=
[];
for
(
const
key
in
window
[
'boxmap'
])
{
if
(
window
[
'boxmap'
].
hasOwnProperty
(
key
))
{
const
element
=
window
[
'boxmap'
][
key
];
list
.
push
(
key
);
}
}
return
list
;
}
}
\ No newline at end of file
egret/src/startScene/BoxType.ts
deleted
100644 → 0
View file @
b1c28df0
export
default
class
BoxType
{
static
coin
=
'coin'
static
gift
=
'coin'
static
gift2
=
'coin'
static
goldenbox
=
'coin'
static
silverbox
=
'coin'
static
woodbox
=
'coin'
}
\ No newline at end of file
egret/src/startScene/IBoxItem.ts
0 → 100644
View file @
d7657c2d
export
default
interface
IBoxItem
{
award
:
number
;
skin
:
string
;
}
\ No newline at end of file
egret/src/startScene/StartScene.ts
View file @
d7657c2d
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
GamePlayModel
}
from
"../../libs/tw/model/game/GamePlayModel"
;
import
{
getResPath
}
from
"../utils"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
Scene
from
"../views/Scene"
;
import
Box
from
"./Box"
;
import
BoxType
from
"./BoxType
"
;
import
IBoxItem
from
"./IBoxItem
"
;
import
Monkey
from
"./Monkey"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
const
{
TouchEvent
}
=
egret
;
export
default
class
StartScene
extends
Scene
{
...
...
@@ -18,7 +17,7 @@ export default class StartScene extends Scene {
const
pic
=
new
egret
.
Bitmap
(
picData
);
this
.
addChild
(
pic
);
const
box
=
new
Box
(
Box
Type
.
coin
);
const
box
=
new
Box
(
Box
.
getBoxList
()[
5
]
);
this
.
addChild
(
box
);
box
.
x
=
box
.
stage
.
stageWidth
/
2
;
box
.
y
=
box
.
stage
.
stageHeight
/
2
;
...
...
@@ -42,14 +41,15 @@ export default class StartScene extends Scene {
box
.
touchEnabled
=
true
;
box
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_BEGIN
,
()
=>
{
const
boxData
:
IBoxItem
=
window
[
'boxmap'
][
box
.
type
];
NetManager
.
ins
.
getInfo
(()
=>
{
model
.
doStart
(()
=>
{
model
.
submit
(()
=>
{
},
window
[
'boxmap'
][
box
.
type
]
)
model
.
submit
(()
=>
{
},
boxData
.
award
)
},
false
);
});
NetManager
.
ins
.
getRule
(()
=>
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
RULE_PANEL
);
})
},
this
);
}
...
...
@@ -66,7 +66,7 @@ export default class StartScene extends Scene {
}
}
async
getBg
()
{
let
url
=
getResPath
()
+
'resource/assets/startScene/bg.jpg'
;
let
url
=
window
[
'__bgUrl__'
]
return
new
Promise
((
resolve
)
=>
{
RES
.
getResByUrl
(
url
,
(
picData
)
=>
{
resolve
(
picData
)
...
...
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