Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
ZheShangBank_TaoQuan_20240612
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
SparkProjects
ZheShangBank_TaoQuan_20240612
Commits
dd1d95c4
Commit
dd1d95c4
authored
Jun 17, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
0b66826e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
161 additions
and
174 deletions
+161
-174
ReviewPanel.ts
assets/Scripts/Panels/ReviewPanel.ts
+0
-4
MainGame.ts
assets/Scripts/Scenes/MainGame.ts
+2
-19
Quan.ts
assets/Scripts/Scenes/MainGame/Quan.ts
+16
-8
Utils.ts
assets/Scripts/Utils/Utils.ts
+143
-143
No files found.
assets/Scripts/Panels/ReviewPanel.ts
View file @
dd1d95c4
...
...
@@ -25,8 +25,6 @@ export default class ReviewPanel extends Panel {
tip
:
Label
=
null
!
;
async
start
()
{
sendLog
(
LOG_TYPE
.
EXPOSURE
,
24
);
sendLog
(
LOG_TYPE
.
EXPOSURE
,
25
);
this
.
ok
.
on
(
Button
.
EventType
.
CLICK
,
this
.
onOk
,
this
);
this
.
close
.
on
(
Button
.
EventType
.
CLICK
,
this
.
onClose
,
this
);
this
.
cancel
.
on
(
Button
.
EventType
.
CLICK
,
this
.
onClose
,
this
);
...
...
@@ -39,7 +37,6 @@ export default class ReviewPanel extends Panel {
* 确认复活
*/
onOk
=
()
=>
{
sendLog
(
LOG_TYPE
.
CLICK
,
25
);
this
.
data
.
review
();
this
.
hidePanel
();
}
...
...
@@ -49,7 +46,6 @@ export default class ReviewPanel extends Panel {
*/
onClose
=
()
=>
{
// 结算
sendLog
(
LOG_TYPE
.
CLICK
,
24
)
this
.
data
.
submit
();
this
.
hidePanel
();
}
...
...
assets/Scripts/Scenes/MainGame.ts
View file @
dd1d95c4
...
...
@@ -28,7 +28,7 @@ import Svga from "db://assets/Component/Svga/Svga";
import
{
showPanel
}
from
"db://assets/Module/UIFast"
;
import
GameChooseHand
from
"db://assets/Scripts/Panels/GameChooseHand"
;
import
ReviewPanel
from
"db://assets/Scripts/Panels/ReviewPanel"
;
import
{
sleep
}
from
"db://assets/Scripts/Utils/Utils"
;
import
{
_asyncThrottle
,
sleep
}
from
"db://assets/Scripts/Utils/Utils"
;
import
{
LOG_TYPE
,
sendLog
,
...
...
@@ -493,9 +493,8 @@ export class MainGame extends Scene {
onTouchMove
=
(
e
:
EventTouch
)
=>
{
};
onTouchEC
=
this
.
throttle
((
event
:
EventTouch
)
=>
{
onTouchEC
=
_asyncThrottle
((
e
:
EventTouch
)
=>
{
if
(
!
this
.
isStart
||
this
.
isOver
)
return
;
let
e
=
event
[
0
];
const
start
=
e
.
getStartLocation
?
e
.
getStartLocation
()
:
e
.
getLocation
();
const
end
=
e
.
getLocation
();
...
...
@@ -506,7 +505,6 @@ export class MainGame extends Scene {
if
(
this
.
isUseGod
)
{
this
.
schedule
(
()
=>
{
console
.
log
(
1
)
this
.
shoot
(
powerScale
,
dp
.
x
/
130
);
},
0.1
,
...
...
@@ -517,21 +515,6 @@ export class MainGame extends Scene {
}
},
1000
);
// 截流
throttle
(
fn
,
delay
)
{
let
prev
=
Date
.
now
();
return
function
()
{
const
context
=
this
,
args
=
arguments
;
let
now
=
Date
.
now
();
// console.log(now, prev);
if
(
now
-
prev
>=
delay
)
{
fn
.
call
(
context
,
args
);
prev
=
now
;
}
};
}
/**
* 发射
* @param powerScale
...
...
assets/Scripts/Scenes/MainGame/Quan.ts
View file @
dd1d95c4
...
...
@@ -46,7 +46,8 @@ export class Quan extends Component {
}
const
collider
=
this
.
node
.
addComponent
(
BoxCollider
);
collider
.
size
=
v3
(
0.8
*
this
.
radius
*
this
.
scale
,
0.1
,
0.8
*
this
.
radius
*
this
.
scale
);
const
w
=
0.85
*
this
.
radius
*
this
.
scale
;
collider
.
size
=
v3
(
w
,
0.08
,
w
);
collider
.
isTrigger
=
true
;
collider
.
on
(
"onTriggerEnter"
,
this
.
onTriggerEnter
,
this
);
}
...
...
@@ -79,7 +80,7 @@ export class Quan extends Component {
this
.
isShoot
=
true
;
this
.
hit
=
false
;
this
.
rb
.
enabled
=
true
;
const
power
=
v3
(
endX
,
27
,
-
22
).
multiply3f
(
1
,
powerScale
,
powerScale
);
const
power
=
v3
(
endX
,
27
.8
,
-
22
).
multiply3f
(
1
,
powerScale
,
powerScale
);
this
.
rb
.
applyImpulse
(
power
);
// this.rb.setLinearVelocity(new Vec3(0, 15, -25));
// this.rb.applyForce(new Vec3(0, 800, -2050));
...
...
@@ -96,6 +97,8 @@ export class Quan extends Component {
this
.
judgeDestroy
();
}
v3
=
new
Vec3
();
/**
* 检测是否停止或者消失
*/
...
...
@@ -103,15 +106,20 @@ export class Quan extends Component {
if
(
!
this
.
isShoot
||
this
.
hit
)
return
;
const
y
=
this
.
node
.
getPosition
().
y
;
// this.frame1Y = this.frame2Y;
// this.frame2Y = this.frame3Y;
// this.frame3Y = y;
//
this
.
frame1Y
=
this
.
frame2Y
;
this
.
frame2Y
=
this
.
frame3Y
;
this
.
frame3Y
=
y
;
this
.
rb
.
getLinearVelocity
(
this
.
v3
);
if
(
this
.
v3
.
length
()
<
0.001
)
{
this
.
node
.
destroy
();
return
;
}
// const dy32 = Math.abs(this.frame3Y - this.frame2Y);
// const dy21 = Math.abs(this.frame2Y - this.frame1Y);
// const dy31 = Math.abs(this.frame3Y - this.frame1Y);
//
// if (dy32 < 0.000
5 && dy21 < 0.0005 && dy31 < 0.0005
) {
// if (dy32 < 0.000
2 && dy21 < 0.0002 && dy31 < 0.0002
) {
// // TODO找个合理的边界值
// // console.log("停止飞行");
// this.node.destroy();
...
...
assets/Scripts/Utils/Utils.ts
View file @
dd1d95c4
This diff is collapsed.
Click to expand it.
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