Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tb_project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
钱根
tb_project
Commits
cd4c30f3
Commit
cd4c30f3
authored
Aug 09, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏数据调试
parent
ac2e77f9
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
227 additions
and
172 deletions
+227
-172
index.html
index.html
+1
-1
p1-b.png
resource/GameScene/p1-b.png
+0
-0
p1.png
resource/GameScene/p1.png
+0
-0
ResJson.ts
src/ResJson.ts
+144
-144
GameConfig.ts
src/scenes/GameScene/GameConfig.ts
+1
-1
GameScene.ts
src/scenes/GameScene/GameScene.ts
+66
-16
MotionInit.ts
src/scenes/GameScene/MotionInit.ts
+15
-10
No files found.
index.html
View file @
cd4c30f3
...
...
@@ -22,7 +22,7 @@
<!-- <script src="libs/svgaParser.min1.js"></script> -->
<script
src=
"//yun.duiba.com.cn/js-libs/vConsole/3.3.4/vconsole.min.js"
></script>
<script>
//
var vConsole = new VConsole();
var
vConsole
=
new
VConsole
();
</script>
<style>
html
,
...
...
resource/GameScene/p1-b.png
View replaced file @
ac2e77f9
View file @
cd4c30f3
13.5 KB
|
W:
|
H:
12.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
resource/GameScene/p1.png
View replaced file @
ac2e77f9
View file @
cd4c30f3
30.8 KB
|
W:
|
H:
107 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/ResJson.ts
View file @
cd4c30f3
This diff is collapsed.
Click to expand it.
src/scenes/GameScene/GameConfig.ts
View file @
cd4c30f3
...
...
@@ -3,7 +3,7 @@ export const GameCfg = {
ispeed
:
0
,
// 初速度
fpsScale
:
1000
/
60
,
// 帧变数
resisteAcc
:
0.06
,
// 摩擦力反加速度
rc
:
2
0
,
// 误差值,距离中心点的误差值
rc
:
4
0
,
// 误差值,距离中心点的误差值
duanpingValue
:
8
/
180
*
Math
.
PI
,
// 默认小于 8 度就算端平
iTime
:
12000
,
// 初始化游戏时间
...
...
src/scenes/GameScene/GameScene.ts
View file @
cd4c30f3
...
...
@@ -100,7 +100,7 @@ export class GameScene extends MotionInitScene {
this
.
cdp
.
addTimeoutFunc
(()
=>
{
// this.cdp.visible = false
//@ts-ignore
my
.
showToast
({
my
&&
my
.
showToast
({
content
:
'游戏结束'
})
})
...
...
@@ -112,7 +112,7 @@ export class GameScene extends MotionInitScene {
initGame
()
{
this
.
cdp
.
start
()
this
.
gameEle
=
this
.
addChild
(
new
GameEle
(
'p1
-b
.png'
,
this
.
centerp
,
()
=>
{
this
.
gameEle
=
this
.
addChild
(
new
GameEle
(
'p1.png'
,
this
.
centerp
,
()
=>
{
this
.
score
+=
1
this
.
gIndex
+=
1
this
.
cdp
.
initTime
=
GameCfg
.
iTime
...
...
@@ -138,20 +138,6 @@ export class GameScene extends MotionInitScene {
}
var
posList
=
[
{
x
:
0
,
y
:
layers
.
stageHeight
+
layers
.
stageOffsetY
},
{
x
:
layers
.
stageWidth
+
layers
.
stageOffsetX
,
y
:
0
},
{
x
:
layers
.
stageWidth
+
layers
.
stageOffsetX
,
y
:
layers
.
stageHeight
+
layers
.
stageOffsetY
}
]
export
class
GameEle
extends
Container
{
rorate
:
number
// 旋转角度
vx
=
GameCfg
.
ispeed
// 当前x速度, 有初速度
...
...
@@ -182,7 +168,21 @@ export class GameEle extends Container {
initUi
(
tn
:
string
)
{
if
(
tn
)
{
this
.
sprite
=
UI
.
Sp
(
this
,
tn
)
var
posList
=
[
{
x
:
0
,
y
:
layers
.
stageHeight
+
layers
.
stageOffsetY
},
{
x
:
layers
.
stageWidth
+
layers
.
stageOffsetX
,
y
:
0
},
{
x
:
layers
.
stageWidth
+
layers
.
stageOffsetX
,
y
:
layers
.
stageHeight
+
layers
.
stageOffsetY
}
]
var
pos
=
posList
[
Math
.
floor
(
Math
.
random
()
*
3
)]
console
.
log
(
posList
,
pos
)
this
.
position
.
set
(
pos
.
x
,
pos
.
y
)
// this.sprite.scaleX = 0.5
// this.sprite.scaleY = 0.5
...
...
@@ -200,6 +200,19 @@ export class GameEle extends Container {
resetInit
(
tName
:
string
)
{
this
.
sprite
.
texture
=
RES
.
getRes
(
tName
)
var
posList
=
[
{
x
:
0
,
y
:
layers
.
stageHeight
+
layers
.
stageOffsetY
},
{
x
:
layers
.
stageWidth
+
layers
.
stageOffsetX
,
y
:
0
},
{
x
:
layers
.
stageWidth
+
layers
.
stageOffsetX
,
y
:
layers
.
stageHeight
+
layers
.
stageOffsetY
}
]
var
pos
=
posList
[
Math
.
floor
(
Math
.
random
()
*
3
)]
this
.
position
.
set
(
pos
.
x
,
pos
.
y
)
...
...
@@ -296,16 +309,53 @@ export class GameEle extends Container {
this
.
setRotation
(
this
.
k
*
(
len
-
GameCfg
.
rc
))
if
(
this
.
isIn
)
{
this
.
isIn
=
false
FYGE
.
Tween
.
removeTweens
(
this
)
GDispatcher
.
dispatchEvent
(
'focus-out'
)
}
}
else
{
if
(
!
this
.
isIn
)
{
this
.
isIn
=
true
this
.
vx
=
0
this
.
vy
=
0
this
.
setRotation
(
0
)
FYGE
.
Tween
.
get
(
this
)
.
to
({
x
:
this
.
fixedCenter
.
x
,
y
:
this
.
fixedCenter
.
y
},
400
)
GDispatcher
.
dispatchEvent
(
'focus-in'
,
()
=>
{
this
.
finishFunc
()
})
}
}
// var len = pos2Len(this, this.fixedCenter)
// if (!this.lastLen) this.lastLen = len
// if (len > this.lastLen && this.isIn) {
// this.isIn = false
// FYGE.Tween.removeTweens(this)
// GDispatcher.dispatchEvent('focus-out')
// }
// this.lastLen = len
// this.setRotation(this.k * (len - 20)) // vtodo 最后20 只是平移
// if (len <= GameCfg.rc) {
// if (!this.isIn) {
// this.isIn = true
// this.vx = 0
// this.vy = 0
// this.setRotation(0)
// FYGE.Tween.get(this)
// .to({
// x: this.fixedCenter.x,
// y: this.fixedCenter.y
// }, 400)
// GDispatcher.dispatchEvent('focus-in', () => {
// this.finishFunc()
// })
// }
// }
}
update
()
{
...
...
src/scenes/GameScene/MotionInit.ts
View file @
cd4c30f3
...
...
@@ -123,6 +123,15 @@ export class MotionInitScene extends Scene {
.
arc
(
layers
.
stageCenterX
,
layers
.
stageCenterY
,
240
,
0
,
2
*
Math
.
PI
)
.
endFill
()
this
.
focusProgress
=
this
.
addChild
(
new
CircleProgressBar
({
x
:
layers
.
stageCenterX
,
y
:
layers
.
stageCenterY
,
// vtodo 这里后面可能会调试
radius
:
260
,
lineWidth
:
15
,
value
:
0
}))
this
.
focusProgress
.
visible
=
false
this
.
centerp
=
setCenterPos
(
UI
.
Sp
(
this
,
'p1-b.png'
))
var
bitMapc
=
Tools
.
getNumTextures
(
'num'
)
...
...
@@ -175,13 +184,8 @@ export class MotionInitScene extends Scene {
// type: 'fill',
// typeColor: 0x111111
// }))
this
.
focusProgress
=
this
.
addChild
(
new
CircleProgressBar
({
x
:
layers
.
stageCenterX
,
y
:
layers
.
stageCenterY
,
// vtodo 这里后面可能会调试
radius
:
260
,
lineWidth
:
15
,
value
:
0
}))
this
.
focusProgress
.
visible
=
true
this
.
bitmapTextCount
.
visible
=
true
FYGE
.
Tween
.
get
(
this
.
holdOnTxt
)
.
set
({
visible
:
true
,
alpha
:
0.4
})
...
...
@@ -192,6 +196,7 @@ export class MotionInitScene extends Scene {
this
.
bitmapTextCount
.
text
=
((
this
.
focusProgress
.
value
*
100
)
>>
0
)
+
"%"
}
})
.
set
({
value
:
0
})
.
to
({
value
:
1
},
3000
)
.
call
(()
=>
{
console
.
log
(
'%c 成功套种'
,
'color: green'
)
...
...
@@ -202,11 +207,11 @@ export class MotionInitScene extends Scene {
},
400
)
removeTimeCountDown
()
{
if
(
this
.
focusProgress
)
{
if
(
this
.
focusProgress
.
visible
)
{
this
.
unshoot
()
FYGE
.
Tween
.
removeTweens
(
this
.
focusProgress
)
this
.
removeChild
(
this
.
focusProgress
)
this
.
bitmapTextCount
.
text
=
''
this
.
focusProgress
.
visible
=
false
this
.
bitmapTextCount
.
visible
=
false
}
FYGE
.
Tween
.
removeTweens
(
this
.
holdOnTxt
)
...
...
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