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
dded310c
Commit
dded310c
authored
Mar 11, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
31315b6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
12 deletions
+26
-12
PlayScene.ts
egret/src/playScene/PlayScene.ts
+26
-12
No files found.
egret/src/playScene/PlayScene.ts
View file @
dded310c
...
@@ -353,6 +353,10 @@ export default class PlayScene extends Scene {
...
@@ -353,6 +353,10 @@ export default class PlayScene extends Scene {
targX
=
LEFT_GROUND
-
BALL_D
;
targX
=
LEFT_GROUND
-
BALL_D
;
}
}
// console.log(targX)
// 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;
Tween
.
to
(
ball
.
view
,
time
,
{
Tween
.
to
(
ball
.
view
,
time
,
{
x
:
targX
,
x
:
targX
,
y
:
1155
,
y
:
1155
,
...
@@ -360,24 +364,34 @@ export default class PlayScene extends Scene {
...
@@ -360,24 +364,34 @@ export default class PlayScene extends Scene {
onComplete
:
()
=>
{
onComplete
:
()
=>
{
ball
.
view
.
x
=
targX
;
ball
.
view
.
x
=
targX
;
playSound
(
SoundType
.
recover
);
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
,
{
Tween
.
to
(
ball
.
view
,
20
,
{
y
:
this
.
line
.
y
-
this
.
line
.
anchorOffsetY
+
BALL_D
/
2
,
y
:
313.4
-
100
,
useFrame
:
true
,
useFrame
:
true
,
onComplete
:
()
=>
{
onComplete
:
()
=>
{
ball
.
view
.
visible
=
false
;
Tween
.
to
(
ball
.
view
,
30
,
{
Tween
.
to
(
ball
.
view
,
15
,
{
x
:
this
.
line
.
x
,
useFrame
:
true
,
useFrame
:
true
,
onComplete
:
()
=>
{
__xx__
:
100
,
this
.
data
.
currentBallNums
++
;
onUpdate
:
(
per
)
=>
{
this
.
ballCount
++
;
ball
.
view
.
x
+=
vx
;
console
.
log
(
per
);
if
(
this
.
ballCount
==
this
.
ballCountAll
)
{
this
.
canShootTag
=
true
;
this
.
onShootEnd
();
}
}
}
})
})
// ball.view.visible = false;
// Tween.to(ball.view, 15, {
// x: this.line.x,
// useFrame: true,
// onComplete: () => {
// this.data.currentBallNums++;
// this.ballCount++;
// if (this.ballCount == this.ballCountAll) {
// this.canShootTag = true;
// this.onShootEnd();
// }
// }
// })
}
}
})
})
}
}
...
...
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