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
86acd211
Commit
86acd211
authored
Mar 11, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dded310c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
PlayScene.ts
egret/src/playScene/PlayScene.ts
+20
-10
No files found.
egret/src/playScene/PlayScene.ts
View file @
86acd211
...
...
@@ -352,11 +352,7 @@ export default class PlayScene extends Scene {
time
=
detaX
<
1
?
1
:
detaX
;
targX
=
LEFT_GROUND
-
BALL_D
;
}
// console.log(targX)
// const { p0, p1, p2 } = this;
// this.bullet.x = (1 - value) * (1 - value) * p0.x + 2 * value * (1 - value) * p1.x + value * value * p2.x;
// this.bullet.y = (1 - value) * (1 - value) * p0.y + 2 * value * (1 - value) * p1.y + value * value * p2.y;
ball
.
view
.
alpha
=
0.80
;
Tween
.
to
(
ball
.
view
,
time
,
{
x
:
targX
,
y
:
1155
,
...
...
@@ -365,17 +361,31 @@ export default class PlayScene extends Scene {
ball
.
view
.
x
=
targX
;
playSound
(
SoundType
.
recover
);
// console.log( this.line.y - this.line.anchorOffsetY + BALL_D / 2)
const
vx
=
(
ball
.
view
.
x
>
375
?
-
1
:
1
)
*
11
;
Tween
.
to
(
ball
.
view
,
20
,
{
y
:
313.4
-
100
,
useFrame
:
true
,
onComplete
:
()
=>
{
Tween
.
to
(
ball
.
view
,
30
,
{
const
middlex
=
375
;
const
p0
=
{
x
:
ball
.
view
.
x
,
y
:
ball
.
view
.
y
};
const
p1
=
{
x
:
(
ball
.
view
.
x
+
middlex
)
/
2
,
y
:
ball
.
view
.
y
-
500
};
const
p2
=
{
x
:
middlex
,
y
:
ball
.
view
.
y
};
Tween
.
to
(
ball
.
view
,
20
,
{
useFrame
:
true
,
__xx__
:
100
,
onUpdate
:
(
per
)
=>
{
ball
.
view
.
x
+=
vx
;
console
.
log
(
per
);
onUpdate
:
(
value
)
=>
{
ball
.
view
.
x
=
(
1
-
value
)
*
(
1
-
value
)
*
p0
.
x
+
2
*
value
*
(
1
-
value
)
*
p1
.
x
+
value
*
value
*
p2
.
x
;
ball
.
view
.
y
=
(
1
-
value
)
*
(
1
-
value
)
*
p0
.
y
+
2
*
value
*
(
1
-
value
)
*
p1
.
y
+
value
*
value
*
p2
.
y
;
console
.
log
(
value
);
},
onComplete
:
()
=>
{
this
.
data
.
currentBallNums
++
;
this
.
ballCount
++
;
ball
.
view
.
visible
=
false
;
ball
.
view
.
alpha
=
1
;
if
(
this
.
ballCount
==
this
.
ballCountAll
)
{
this
.
canShootTag
=
true
;
this
.
onShootEnd
();
}
}
})
// ball.view.visible = false;
...
...
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