Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
JsxForFYGETemplate
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
spc
JsxForFYGETemplate
Commits
b08a4d5d
Commit
b08a4d5d
authored
Dec 16, 2022
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 按压进度
parent
18dd1f4c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
745 additions
and
21 deletions
+745
-21
progressBack.png
resource/GameScene/progressBack.png
+0
-0
res.json
resource/res.json
+1
-1
ResJson.ts
src/ResJson.ts
+675
-17
GameScene.tsx
src/scenes/GameScene/GameScene.tsx
+69
-3
No files found.
resource/GameScene/progressBack.png
0 → 100644
View file @
b08a4d5d
3.55 KB
resource/res.json
View file @
b08a4d5d
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
"name"
:
"GameResumeModal"
"name"
:
"GameResumeModal"
},
},
{
{
"keys"
:
"back.png,bottomAtom.png,gele1.png,goBackBtn.png,player.png,scoreboard-t.png"
,
"keys"
:
"back.png,bottomAtom.png,gele1.png,goBackBtn.png,player.png,
progressBack.png,
scoreboard-t.png"
,
"name"
:
"GameScene"
"name"
:
"GameScene"
},
},
{
{
...
...
src/ResJson.ts
View file @
b08a4d5d
This diff is collapsed.
Click to expand it.
src/scenes/GameScene/GameScene.tsx
View file @
b08a4d5d
...
@@ -29,6 +29,54 @@ import { GameEle } from "./GameEle";
...
@@ -29,6 +29,54 @@ import { GameEle } from "./GameEle";
import
{
Player
,
PlayerIns
}
from
"./Player"
;
import
{
Player
,
PlayerIns
}
from
"./Player"
;
import
{
Stack
}
from
"./Stack"
;
import
{
Stack
}
from
"./Stack"
;
class
ProgressBar
extends
Dream
.
RenderContainer
{
_value
:
number
=
0
progressWrap
:
FYGE
.
Container
progressbar
:
FYGE
.
Shape
maxLen
:
number
get
value
()
{
return
this
.
_value
}
set
value
(
v
)
{
this
.
_value
=
v
this
.
progressbar
.
y
=
(
1
-
v
)
*
this
.
maxLen
}
didRendered
():
void
{
const
roleCont
=
RES
.
getRes
(
'progressBack.png'
)
this
.
maxLen
=
roleCont
.
height
const
shape
=
this
.
progressbar
=
new
FYGE
.
Shape
()
shape
.
beginFill
(
'#fff5dc'
)
shape
.
drawRoundedRect
(
0
,
0
,
roleCont
.
width
,
roleCont
.
height
,
50
)
shape
.
endFill
()
this
.
progressWrap
.
addChild
(
shape
)
shape
.
mask
=
shape
.
parent
.
addChild
(
new
FYGE
.
Graphics
())
.
beginFill
(
0xf8c862
)
.
drawRoundedRect
(
0
,
0
,
roleCont
.
width
,
roleCont
.
height
,
111
)
.
endFill
()
this
.
value
=
0
}
render
()
{
return
(
<
DreamContainer
>
<
DreamSprite
src=
{
RES
.
getRes
(
'progressBack.png'
)
}
/>
<
DreamContainer
ref=
{
el
=>
{
this
.
progressWrap
=
el
}
}
>
</
DreamContainer
>
</
DreamContainer
>
)
}
}
/**
/**
* 获取 n-m之间的 随机数
* 获取 n-m之间的 随机数
* @param {Number} m
* @param {Number} m
...
@@ -124,6 +172,7 @@ export class GameScene extends Dream.RenderContainer {
...
@@ -124,6 +172,7 @@ export class GameScene extends Dream.RenderContainer {
isOver
:
boolean
=
false
isOver
:
boolean
=
false
isCouldHaveGift
:
boolean
=
true
isCouldHaveGift
:
boolean
=
true
isWithGift
:
boolean
=
false
isWithGift
:
boolean
=
false
ProgressBarIns
:
ProgressBar
private
_dir
:
1
|
-
1
private
_dir
:
1
|
-
1
get
dir
()
{
get
dir
()
{
...
@@ -193,7 +242,11 @@ export class GameScene extends Dream.RenderContainer {
...
@@ -193,7 +242,11 @@ export class GameScene extends Dream.RenderContainer {
const
touchPushObj
=
this
.
touchPushObj
=
{
const
touchPushObj
=
this
.
touchPushObj
=
{
tl
:
0
tl
:
0
}
}
FYGE
.
Tween
.
get
(
touchPushObj
)
FYGE
.
Tween
.
get
(
touchPushObj
,
{
onChange
:
()
=>
{
this
.
ProgressBarIns
.
value
=
touchPushObj
.
tl
/
GameConfig
.
maxLen
}
})
.
to
({
.
to
({
tl
:
GameConfig
.
maxLen
tl
:
GameConfig
.
maxLen
},
1600
)
},
1600
)
...
@@ -269,11 +322,18 @@ export class GameScene extends Dream.RenderContainer {
...
@@ -269,11 +322,18 @@ export class GameScene extends Dream.RenderContainer {
onJumpSuc
()
{
onJumpSuc
()
{
console
.
log
(
'onJumpSuc'
)
console
.
log
(
'onJumpSuc'
)
PlayAudio
()
if
(
this
.
isWithGift
)
{
if
(
this
.
isWithGift
)
{
this
.
DecisionConfig
.
geleIns
.
onGetGift
()
this
.
DecisionConfig
.
geleIns
.
onGetGift
()
this
.
isDrawed
=
true
this
.
isDrawed
=
true
// @ts-ignore
if
(
my
)
{
// @ts-ignore
my
.
showToast
({
content
:
'恭喜获得惊喜抽奖机会'
})
}
}
else
{
}
else
{
PlayAudio
()
this
.
onAddScore
()
this
.
onAddScore
()
}
}
this
.
onGenerateBox
()
this
.
onGenerateBox
()
...
@@ -406,7 +466,6 @@ export class GameScene extends Dream.RenderContainer {
...
@@ -406,7 +466,6 @@ export class GameScene extends Dream.RenderContainer {
.
to
({
.
to
({
y
:
config
.
offsetY
y
:
config
.
offsetY
},
200
,
FYGE
.
Ease
.
quadIn
)
},
200
,
FYGE
.
Ease
.
quadIn
)
.
wait
(
300
)
.
call
(()
=>
{
.
call
(()
=>
{
this
.
isPaused
=
false
this
.
isPaused
=
false
PlayerTarget
.
_index
=
0
// 初始化一下
PlayerTarget
.
_index
=
0
// 初始化一下
...
@@ -645,6 +704,13 @@ export class GameScene extends Dream.RenderContainer {
...
@@ -645,6 +704,13 @@ export class GameScene extends Dream.RenderContainer {
)
)
}
}
<
DreamContainer
inlineProps=
{
{
x
:
680
,
y
:
500
}
}
>
<
ProgressBar
ref=
{
(
el
:
ProgressBar
)
=>
this
.
ProgressBarIns
=
el
}
/>
</
DreamContainer
>
<
FYGE
.
Container
inlineProps=
{
{
<
FYGE
.
Container
inlineProps=
{
{
y
:
1624
-
bottomAtomRes
.
height
y
:
1624
-
bottomAtomRes
.
height
}
}
>
}
}
>
...
...
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