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
0912c937
Commit
0912c937
authored
Oct 12, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9bbe9bd6
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
84 additions
and
9 deletions
+84
-9
.DS_Store
egret/.DS_Store
+0
-0
coinOpenState.png
egret/design/开启状态/coinOpenState.png
+0
-0
gift2OpenState.png
egret/design/开启状态/gift2OpenState.png
+0
-0
giftOpenState.png
egret/design/开启状态/giftOpenState.png
+0
-0
goldenboxOpenState.png
egret/design/开启状态/goldenboxOpenState.png
+0
-0
silverboxOpenState.png
egret/design/开启状态/silverboxOpenState.png
+0
-0
woodboxOpenState.png
egret/design/开启状态/woodboxOpenState.png
+0
-0
index.html
egret/index.html
+1
-0
config.d.ts
egret/libs/config.d.ts
+2
-1
guide_4.tmproject
egret/resource/TextureMerger/guide_4.tmproject
+1
-0
openstate.json
egret/resource/assets/startScene/openstate.json
+7
-0
openstate.png
egret/resource/assets/startScene/openstate.png
+0
-0
MyExmlPlugin.ts
egret/scripts/MyExmlPlugin.ts
+1
-0
Box.ts
egret/src/startScene/Box.ts
+1
-1
Monkey.ts
egret/src/startScene/Monkey.ts
+1
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+22
-6
BoxOpenState.ts
egret/src/startScene/view/BoxOpenState.ts
+48
-0
No files found.
egret/.DS_Store
View file @
0912c937
No preview for this file type
egret/design/开启状态/coinOpenState.png
0 → 100644
View file @
0912c937
21 KB
egret/design/开启状态/gift2OpenState.png
0 → 100644
View file @
0912c937
46.8 KB
egret/design/开启状态/giftOpenState.png
0 → 100644
View file @
0912c937
36.7 KB
egret/design/开启状态/goldenboxOpenState.png
0 → 100644
View file @
0912c937
54.9 KB
egret/design/开启状态/silverboxOpenState.png
0 → 100644
View file @
0912c937
85.3 KB
egret/design/开启状态/woodboxOpenState.png
0 → 100644
View file @
0912c937
78.6 KB
egret/index.html
View file @
0912c937
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
var
__debug__
=
1
;
var
__debug__
=
1
;
var
__monkeyHandSize__
=
50
;
var
__monkeyHandSize__
=
50
;
var
__boxMoveSpeed__
=
6
;
var
__boxMoveSpeed__
=
6
;
var
__boxOpenState__
=
'resource/assets/startScene/openstate.json'
;
var
__boxmap__
=
{
var
__boxmap__
=
{
coin
:{
award
:
0
,
skin
:
'resource/assets/startScene/coin.json'
,
offset
:
[
117
,
68
]
},
coin
:{
award
:
0
,
skin
:
'resource/assets/startScene/coin.json'
,
offset
:
[
117
,
68
]
},
gift
:{
award
:
0
,
skin
:
'resource/assets/startScene/gift.json'
,
offset
:
[
119
,
103
]
},
gift
:{
award
:
0
,
skin
:
'resource/assets/startScene/gift.json'
,
offset
:
[
119
,
103
]
},
...
...
egret/libs/config.d.ts
View file @
0912c937
...
@@ -15,3 +15,4 @@ declare var __boxmap__: { [key: string]: IBoxItem };
...
@@ -15,3 +15,4 @@ declare var __boxmap__: { [key: string]: IBoxItem };
declare
var
__bgUrl__
:
string
;
declare
var
__bgUrl__
:
string
;
declare
var
__monkeyHandSize__
:
number
;
declare
var
__monkeyHandSize__
:
number
;
declare
var
__boxMoveSpeed__
:
number
;
declare
var
__boxMoveSpeed__
:
number
;
declare
var
__boxOpenState__
:
string
;
\ No newline at end of file
egret/resource/TextureMerger/guide_4.tmproject
0 → 100644
View file @
0912c937
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"guide_4","version":5,"files":["../assets/startScene/guide/guide_tips.png","../assets/startScene/guide/guide_hand.png","../assets/startScene/guide/guide_dialog.png"]}
\ No newline at end of file
egret/resource/assets/startScene/openstate.json
0 → 100644
View file @
0912c937
{
"file"
:
"openstate.png"
,
"frames"
:{
"silverboxOpenState"
:{
"x"
:
0
,
"y"
:
0
,
"w"
:
292
,
"h"
:
222
,
"offX"
:
0
,
"offY"
:
0
,
"sourceW"
:
292
,
"sourceH"
:
222
},
"woodboxOpenState"
:{
"x"
:
762
,
"y"
:
0
,
"w"
:
220
,
"h"
:
209
,
"offX"
:
0
,
"offY"
:
0
,
"sourceW"
:
220
,
"sourceH"
:
209
},
"coinOpenState"
:{
"x"
:
294
,
"y"
:
216
,
"w"
:
148
,
"h"
:
151
,
"offX"
:
2
,
"offY"
:
3
,
"sourceW"
:
150
,
"sourceH"
:
154
},
"gift2OpenState"
:{
"x"
:
543
,
"y"
:
0
,
"w"
:
217
,
"h"
:
232
,
"offX"
:
0
,
"offY"
:
0
,
"sourceW"
:
217
,
"sourceH"
:
232
},
"goldenboxOpenState"
:{
"x"
:
294
,
"y"
:
0
,
"w"
:
247
,
"h"
:
214
,
"offX"
:
0
,
"offY"
:
0
,
"sourceW"
:
247
,
"sourceH"
:
214
},
"giftOpenState"
:{
"x"
:
762
,
"y"
:
211
,
"w"
:
206
,
"h"
:
218
,
"offX"
:
0
,
"offY"
:
0
,
"sourceW"
:
206
,
"sourceH"
:
218
}}}
\ No newline at end of file
egret/resource/assets/startScene/openstate.png
0 → 100644
View file @
0912c937
402 KB
egret/scripts/MyExmlPlugin.ts
View file @
0912c937
...
@@ -8,6 +8,7 @@ import { ExmlPlugin2 } from "./ExmlPlugin2";
...
@@ -8,6 +8,7 @@ import { ExmlPlugin2 } from "./ExmlPlugin2";
export
class
MyExmlPlugin
extends
ExmlPlugin2
implements
plugins
.
Command
{
export
class
MyExmlPlugin
extends
ExmlPlugin2
implements
plugins
.
Command
{
async
onFile
(
file
:
plugins
.
File
)
{
async
onFile
(
file
:
plugins
.
File
)
{
const
excludes
=
[
const
excludes
=
[
'openstate.png'
,
'coin.png'
,
'coin.png'
,
'gift.png'
,
'gift.png'
,
'gift2.png'
,
'gift2.png'
,
...
...
egret/src/startScene/Box.ts
View file @
0912c937
...
@@ -82,7 +82,7 @@ export default class Box extends egret.Sprite {
...
@@ -82,7 +82,7 @@ export default class Box extends egret.Sprite {
});
});
}
}
private
_vyStart
=
1
5
;
private
_vyStart
=
1
2
;
private
_vy
:
number
;
private
_vy
:
number
;
private
_gy
:
number
;
private
_gy
:
number
;
private
_throwStartVY
:
number
;
private
_throwStartVY
:
number
;
...
...
egret/src/startScene/Monkey.ts
View file @
0912c937
...
@@ -12,7 +12,7 @@ export default class Monkey extends egret.Sprite {
...
@@ -12,7 +12,7 @@ export default class Monkey extends egret.Sprite {
private
targetY
=
70
;
private
targetY
=
70
;
private
targetX
=
369
;
private
targetX
=
369
;
static
RANGE
=
60
;
static
RANGE
=
60
;
private
_shakeSpeed
=
1
;
private
_shakeSpeed
=
.
5
;
constructor
()
{
constructor
()
{
super
();
super
();
this
.
anchorOffsetX
=
113
;
this
.
anchorOffsetX
=
113
;
...
...
egret/src/startScene/StartScene.ts
View file @
0912c937
import
{
GamePlayModel
}
from
"../../libs/tw/model/game/GamePlayModel"
;
import
{
GamePlayModel
}
from
"../../libs/tw/model/game/GamePlayModel"
;
import
Scene
from
"../views/Scene"
;
import
Scene
from
"../views/Scene"
;
import
Box
from
"./Box"
;
import
BoxListCtrl
from
"./BoxListCtrl"
;
import
BoxListCtrl
from
"./BoxListCtrl"
;
import
Monkey
from
"./Monkey
"
;
import
LayerTypes
from
"./data/LayerTypes
"
;
import
Net
from
"./Net
"
;
import
debug
from
"./debug
"
;
import
Guide
from
"./Guide"
;
import
Guide
from
"./Guide"
;
import
GuideCtrl
from
"./GuideCtrl"
;
import
GuideCtrl
from
"./GuideCtrl"
;
import
Box
from
"./Box
"
;
import
Monkey
from
"./Monkey
"
;
import
debug
from
"./debug
"
;
import
Net
from
"./Net
"
;
import
LayerTypes
from
"./data/LayerTypes
"
;
import
BoxOpenState
from
"./view/BoxOpenState
"
;
const
{
TouchEvent
}
=
egret
;
const
{
TouchEvent
}
=
egret
;
export
default
class
StartScene
extends
Scene
{
export
default
class
StartScene
extends
Scene
{
...
@@ -52,6 +53,8 @@ export default class StartScene extends Scene {
...
@@ -52,6 +53,8 @@ export default class StartScene extends Scene {
this
.
_debug
=
new
debug
(
this
.
getLayer
(
LayerTypes
.
top
));
this
.
_debug
=
new
debug
(
this
.
getLayer
(
LayerTypes
.
top
));
}
}
const
model
=
new
GamePlayModel
();
const
model
=
new
GamePlayModel
();
model
.
update
();
model
.
update
();
...
@@ -82,6 +85,7 @@ export default class StartScene extends Scene {
...
@@ -82,6 +85,7 @@ export default class StartScene extends Scene {
}
}
private
_catchedBox
:
Box
;
private
_catchedBox
:
Box
;
private
_cathchedBoxOpenState
:
BoxOpenState
;
doAction
()
{
doAction
()
{
this
.
_net
.
doAction
();
this
.
_net
.
doAction
();
const
catchedBoxs
=
this
.
_boxListCtrl
.
boxs
.
filter
(
const
catchedBoxs
=
this
.
_boxListCtrl
.
boxs
.
filter
(
...
@@ -135,8 +139,20 @@ export default class StartScene extends Scene {
...
@@ -135,8 +139,20 @@ export default class StartScene extends Scene {
onNotCatchedByMonkey
()
{
onNotCatchedByMonkey
()
{
this
.
removeThrowTick
();
this
.
removeThrowTick
();
this
.
_cathchedBoxOpenState
=
new
BoxOpenState
(
this
.
_catchedBox
.
type
);
this
.
_cathchedBoxOpenState
.
x
=
this
.
_catchedBox
.
x
;
this
.
_cathchedBoxOpenState
.
y
=
this
.
_catchedBox
.
y
;
this
.
topLay
.
addChild
(
this
.
_cathchedBoxOpenState
);
this
.
_cathchedBoxOpenState
.
onReady
=
()
=>
{
egret
.
Tween
.
get
(
this
.
_catchedBox
).
to
({
alpha
:
0
},
500
);
this
.
_catchedBox
=
null
;
this
.
_catchedBox
=
null
;
}
}
this
.
_cathchedBoxOpenState
.
start
();
setTimeout
(()
=>
{
this
.
_cathchedBoxOpenState
.
destroy
();
this
.
_cathchedBoxOpenState
=
null
;
},
1000
);
}
private
_handX
:
number
;
private
_handX
:
number
;
private
_handY
:
number
;
private
_handY
:
number
;
...
...
egret/src/startScene/view/BoxOpenState.ts
0 → 100644
View file @
0912c937
export
default
class
BoxOpenState
extends
egret
.
Bitmap
{
_type
:
string
;
onReady
:
()
=>
void
;
constructor
(
type
)
{
super
();
this
.
_type
=
type
;
}
start
():
any
{
RES
.
getResByUrl
(
__boxOpenState__
,
(
sheet
:
egret
.
SpriteSheet
)
=>
{
const
texture
=
sheet
.
getTexture
(
`
${
this
.
_type
}
OpenState`
);
this
.
$setBitmapData
(
texture
);
this
.
anchorOffsetX
=
texture
.
textureWidth
>>
1
;
this
.
anchorOffsetY
=
texture
.
textureHeight
>>
1
;
this
.
scaleX
=
this
.
scaleY
=
1.5
;
egret
.
Tween
.
get
(
this
)
.
set
({
alpha
:
0
})
.
to
({
alpha
:
1
},
200
)
.
call
(()
=>
{
this
.
onReady
();
this
.
shake
();
})
},
this
,
RES
.
ResourceItem
.
TYPE_SHEET
);
}
destroy
()
{
egret
.
Tween
.
removeTweens
(
this
);
egret
.
Tween
.
get
(
this
).
to
({
alpha
:
0
},
500
).
call
(()
=>
{
this
.
parent
.
removeChild
(
this
);
});
}
shake
():
any
{
const
x0
=
this
.
x
;
const
y0
=
this
.
y
;
const
offset
=
10
;
egret
.
Tween
.
get
(
this
,
{
loop
:
true
})
.
set
({
y
:
y0
-
offset
,
x
:
x0
}).
wait
(
30
)
.
set
({
y
:
y0
,
x
:
x0
+
offset
}).
wait
(
30
)
.
set
({
y
:
y0
+
offset
,
x
:
x0
}).
wait
(
30
)
.
set
({
y
:
y0
,
x
:
x0
-
offset
}).
wait
(
30
)
.
set
({
y
:
y0
-
offset
,
x
:
x0
}).
wait
(
30
)
.
set
({
y
:
y0
,
x
:
x0
+
offset
}).
wait
(
30
)
.
set
({
y
:
y0
+
offset
,
x
:
x0
}).
wait
(
30
)
.
set
({
y
:
y0
,
x
:
x0
-
offset
}).
wait
(
30
)
.
wait
(
500
);
}
}
\ 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